Forum Moderators: open

Message Too Old, No Replies

end tag for element "form" which is not open w3c validation

         

yabai

1:28 pm on Oct 5, 2005 (gmt 0)

10+ Year Member



hi,

i am using xhtml transitional but keep getting one validation error. (end tag for element "form" which is not open)

Here is the code below;

<form method="get" name="tip_Form" class="form" action="search/results.html" />
search:
<input name="d" type="text" size="10" style="vertical-align: middle;" />
<input type="hidden" name="n" value="0" />
<input type="image" src="images/go.gif" alt="Click here to search" value="go" style="vertical-align: middle;" />
</form>

It is doing my head in. Any help would be great!

Thanks.

mattur

1:38 pm on Oct 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're closing the form tag as soon as you open it. <form /> is equivalent to <form></form>

Change it to:
<form method="get" name="tip_Form" class="form" action="search/results.html">
...
<!-- because you close the form tag here: -->
</form>

yabai

1:45 pm on Oct 5, 2005 (gmt 0)

10+ Year Member



cheers! it is so easy when you haven't been staring at it for hours!

Thanks again!

mattur

9:49 pm on Oct 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yup, I know that feeling..!

BTW: you may want to also use a label tag. It's the structured-markup "way", makes it easily stylable, and contributes to usability and accessibility too.

...
<label for="d">search:</label>
<input name="d" id="d" type="text" size="10" style="vertical-align: middle;" />
...