Forum Moderators: open

Message Too Old, No Replies

Problem validating

document type does not allow element "FORM" here

         

palmpal

10:14 pm on Mar 13, 2003 (gmt 0)

10+ Year Member



Hello,
My website validated to HTML 4.01 until recently. I added a CGI script for a poll and now I have a validation error.

My source code:
form method="post" action="http://www.mysite.com/cgi-bin/survey/survey.pl">

My error message:
document type does not allow element "FORM" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME" start-tag

Can anyone tell me what the problem is? I'm pretty new to CGI scripts.

Thanks!

Alternative Future

10:24 pm on Mar 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi palmpal,

Not too sure on cgi either but only thing i can see that might be causing the error is a name for the form!? which is used in the Document Object Model (DOM) [added]or try placing a type= again this might help![/added]

But as said am not to sure either :(

HTH,

-gs

tedster

10:39 pm on Mar 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The message talks about the document type - what DTD are you using?

And I realise this may just be a copy/paste error, but your posted code has no < at the beginning of the form tag.

Allen

8:48 am on Mar 14, 2003 (gmt 0)

10+ Year Member



Are tags nested correctly?

You haven't got something like:
<table>
<form>
<....content....>
</table>
</form>

also check that your form tag isn't somewhere illegal like outside the body tag.

Allen

g1smd

12:30 am on Mar 15, 2003 (gmt 0)

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



Ca you post the 10 lines of code around the place the error is reported?

palmpal

2:52 am on Mar 15, 2003 (gmt 0)

10+ Year Member



OK here is my document type info:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Here is some of the code before and after the error. I have no other validation errors on this page except for the one mentioned in my earlier post.

<table cellspacing="0" cellpadding="0" width="50%">
<tr>
<td align="center"><a HREF="pkt015.htm">
<img BORDER="0" SRC="images/pkt015.jpg" ALT="Best Friends" width="100" height="102"></a></td>
<td align="center"><h4 CLASS="scpbody"><br>New!<br>Best Friends<br>Album!</h4>
</td>
</tr>
</table><BR>
<H4 CLASS="scpbody"><a href="#prod_name">View Product Categories</a><BR><BR>
Find out about new digital scrapbooking<br>products by <a href="#news">signing up</a> for our<br>monthly newsletter below!<BR></H4>
<a name="#prod_name"><IMG SRC="images/flwd.jpg" ALT="" WIDTH="300"></a><BR><BR>
<!-- start here -->
<H4 CLASS="scpbody">When should new holiday layouts be added?<br>
<form method="post" action="http://www.mysite.com/cgi-bin/survey/survey.pl">
<input type="hidden" name="id" value="1">
<input type="radio" name="response" value="1">Before the Holiday<br>
<input type="radio" name="response" value="2">After the Holiday<br>
<input type="radio" name="response" value="3">Doesn't Matter<br>
<input type="submit" value="Vote!"></form></H4>
<!-- end here --></DIV>
<TABLE BORDER="0" CELLSPACING="0" WIDTH="100%">
<TR>
<TD WIDTH="50%"><DIV ALIGN="center"><A HREF="ppa.html">
<IMG SRC="images/pktbg.jpg" ALT="Pocket Photo Albums" BORDER="0" width="230" height="100"></A></DIV></TD>

Thanks for taking a look!

Palmpal

Nicu_Alecu

6:40 am on Mar 15, 2003 (gmt 0)

10+ Year Member



My guess (I'm actually pretty sure on this, but I still wouldn't stick my neck out ... LOL) is that you contained the form inside a <H4> tag. Try removing the <h4> (yeah, I know, it might mess things up) and see if it validates.

tedster

6:56 am on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No question in my mind (out goes the neck!) Just close the H4 tag before the form tag opens and you should have it nailed.

Nicely spotted, Nicu_Alecu

g1smd

9:13 pm on Mar 15, 2003 (gmt 0)

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



As <h> tags are for headings, you are best off just using them to enclose a few words that are a heading. I agree with the above two posts, you are using the <h> tag incorrectly.

palmpal

11:06 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



Thank you All!

I changed the <H> tags to <DIV> and everything validates fine. You are the best!

Palmpal

g1smd

9:10 am on Mar 16, 2003 (gmt 0)

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



If you have some short pieces of text that are paragraph headings then you should enclose them in <h> tags. The content of these tags is indexed by search engines.

One way to check your document outline is to feed the site through [validator.w3.org...] ticking the box show outline, scroll down past the error list to see your outline.