I have simple form and placed it inside the < div id="center">. It's working fine but still getting warning. why so ?
e.g. < div id="center">
<div id = "center">
<form action="test" method="post">
<input type="hidden" id="text1" name="texts"/> </input> --> getting warning
</form> </div>
Thanks in advance.
For example, the input field is invalid if the required attribute is set and the field is empty (the required attribute specifies that the input field must be filled out before submitting the form). The numbers in the table specify the first browser version that fully supports the event attribute.
HTML oninvalid Event Attribute 1 Definition and Usage. The oninvalid event occurs when a submittable <input> element is invalid. ... 2 Browser Support. The numbers in the table specify the first browser version that fully supports the event attribute. 3 Syntax 4 Attribute Values 5 Technical Details 6 More Examples 7 Related Pages
The form tag may only contain block elements is XHTML Strict, so neither <span> nor <input> is valid. You can wrap it in a <div> though, then it is fine.
An <input>
element cannot be a child element of <form>
. A block element needs to go there.
You need something like form --> fieldset --> input
or form --> div --> input
.
You also have a self-closing <input />
followed by an end tag </input>
which doesn't have an open input to close.
You have already closed the input tag
<input type="hidden" id="text1" name="texts"/>
Written in this form is a self-closing tag. There is no need to close it in explicit form. Plus input must be inside a block container. Check the example here http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With