Forum Moderators: open

Message Too Old, No Replies

W3C validator errors

too many errors...

         

dnimrodx

9:03 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



I don't understand these errors I'm getting with the W3C validator

<div id="account">
<table style="width: 165px;">
<tr>
<td class="title">

Account
</td>
</tr>
<tr>
<td class="content">
<form method="post" action="login.php">
Username<br />
<input class="account_text" type="text" name="username" maxlength="15" />
<br />
Password<br />
<input class="account_text" type="password" name="password" maxlength="25" />
<br />
<input type="checkbox" name="remember_login" value="1" />Remember login?
<input type="hidden" name="redirect" value="%2F" />
<input class="submit" style="margin-top: 3px;" type="submit" name="login" value="Login" />

</form>
<a href="register.php">Register</a><br />
<a href="forgotpassword.php">Forgot Password?</a>
</td>
</tr>
</table>
</div>

Below are the results of attempting to parse this document with an SGML parser.

1. Line 53, column 0: character data is not allowed here

Username<br />
^

2. Line 53, column 13: document type does not allow element "br" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

Username<br />
^

3. Line 54, column 72: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

... type="text" name="username" maxlength="15" />
^

4. Line 55, column 5: document type does not allow element "br" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<br />
^

5. Line 56, column 13: document type does not allow element "br" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

Password<br />
^

6. Line 57, column 76: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

...assword" name="password" maxlength="25" />
^

7. Line 58, column 5: document type does not allow element "br" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<br />
^

8. Line 59, column 56: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<input type="checkbox" name="remember_login" value="1" />Remember login?
^

9. Line 60, column 50: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<input type="hidden" name="redirect" value="%2F" />
^

10. Line 61, column 89: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

..."submit" name="login" value="Login" />

wkitty42

10:15 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



which validator? it looks to me like you are trying to use the html validator with non-html code... that looks like xhtml?

iamlost

10:40 pm on Feb 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You are not using proper "form" syntax.

Check out the w3c example and info at:
ht*p://www.w3.org/TR/2001/WD-xforms-20010608/slice2.html

The fix is much easier than the error list looks!

DrDoc

10:50 pm on Feb 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's even easier than that! [w3.org...]

All inline elements must reside in a block level container. That's what the error message

missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
is indicating. So, just wrap your form contents in a paragraph or, even better, fieldset. :)

dnimrodx

11:06 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



Thank you so much! My brain has stopped functioning for some 3 hours ago or so. Need to sleep desperately as I've not had any for the past 2 days...

Again, thank you guys ;)

vkaryl

3:03 am on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And thank you all from me too! I stumbled on the "wrap in paragraph" fix by accident, but "fieldset" is so much better for my purposes.

Again, I reiterate, you are all MARVELOUS, and THANK YOU!