homepage Welcome to WebmasterWorld Guest from 54.211.231.221
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Won't validate
validate
babushka




msg:4173665
 10:21 pm on Jul 20, 2010 (gmt 0)

Why won't this validate? It says HEAD tag not finished and also Form tag not finished. I took out the form and meta stuff and still it says the head tag is not finished. And I can not get the form to validate at all.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<META http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
</HEAD>
<BODY>
<DIV id=page>

<FORM action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST" name="fback">

</FORM>

</DIV> <!-- page -->
</BODY>
</HTML>


 

Demaestro




msg:4173671
 10:25 pm on Jul 20, 2010 (gmt 0)

I think it is because you need to close the singular tags.

<META http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">

Should be:
<META http-equiv=content-type content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="en-us" />

Fotiman




msg:4173672
 10:26 pm on Jul 20, 2010 (gmt 0)

You need to have a <title> element in the <head> in order for it to be valid.

Fotiman




msg:4173673
 10:27 pm on Jul 20, 2010 (gmt 0)

Note, you only need to close the meta tags with XHTML (so that's not the cause, as this is using an HTML 4 DOCTYPE).

Demaestro




msg:4173701
 11:07 pm on Jul 20, 2010 (gmt 0)

Thanks for the clarification. I still don't have all my doctype rules straight.

babushka




msg:4173702
 11:09 pm on Jul 20, 2010 (gmt 0)

Ok thank you. I put the title tag back in and the head validates. But I am still back to my original problem which is getting the form to validate. Any ideas?



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<META http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>test</TITLE>
</HEAD>
<BODY>
<DIV id=page>

<FORM action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST" name="fback">

</FORM>

</DIV> <!-- page -->
</BODY>
</HTML>


babushka




msg:4173722
 11:49 pm on Jul 20, 2010 (gmt 0)

I'm down to bare minimum. Why won't it validate?



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<META http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>test</TITLE>
</HEAD>
<BODY>

<FORM action="/test.php" method="POST" >

</FORM>

</BODY>


babushka




msg:4173727
 11:51 pm on Jul 20, 2010 (gmt 0)


I changed to loose to get it to validate but that doesn't make sense. It should validate with strict no?



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">


vrtlw




msg:4173733
 12:14 am on Jul 21, 2010 (gmt 0)

Your form is not complete, see this example.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<META http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>test</TITLE>
</HEAD>
<BODY>
<FORM action="/test.php" method="POST" >
<P>Your comments?<BR>
<TEXTAREA Name="comments" rows="4" cols="20"></TEXTAREA>
<P><INPUT Type="submit" Value="Send">
<INPUT Type="reset" Value="Cancel">
</FORM>
</BODY>

Fotiman




msg:4174024
 1:44 pm on Jul 21, 2010 (gmt 0)

The FORM element [w3.org] is defined by the DTD like this:

<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->

The part I've bolded means that the element must contain at least 1 %block% [w3.org] or SCRIPT element child. I've never understood why this was a requirement, but in any case I typically get around this by always wrapping the inner contents of my form in a DIV element:

<form action="/test.php" method="POST">
<div>
<!-- Contents of form go here -->
</div>
</form>

babushka




msg:4174112
 3:32 pm on Jul 21, 2010 (gmt 0)

ok thanks

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved