Welcome to WebmasterWorld Guest from 54.144.124.152

Forum Moderators: incrediBILL

Message Too Old, No Replies

Won't validate

validate

     

babushka

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

5+ Year Member



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

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

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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

Fotiman

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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

babushka

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

5+ Year Member



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

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

5+ Year Member



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

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

5+ Year Member




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

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

10+ Year Member



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

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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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

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

5+ Year Member



ok thanks
 

Featured Threads

Hot Threads This Week

Hot Threads This Month