Field check. The field is inside the form and has input data outside
<form id="youtube-form" method="post" action="">
<label for="searchField" id="label-youtube-id">YouTube ID:</label>
<input type="text" id="searchField" name="videoid" class="search-field" />
<fieldset id="outputFieldset">
<legend>Output format:</legend>
<label for="flv">FLV</label>
<input type="radio" id="flv" name="format" class="radio-button" value="flv" />
<label for="avi">AVI</label>
<input type="radio" id="avi" name="format" class="radio-button" value="avi" />
<label for="mp3">MP3</label>
<input type="radio" id="mp3" name="format" class="radio-button" value="mp3" />
</fieldset>
<input id="youtube-submit" type="submit" name="submit" value="Submit" />
</form>
What's wrong with this code? I seem to be getting an error while checking. (three of them too)
Line 21, column 49: document type do not allow "label" element here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "start tag "fieldset
Is it because I need to add additional fields, or is it something else I did wrong?
Any help is greatly appreciated :)
source to share
input
and are label
not allowed as children of elements form
.
ins
, del
, h1
, h2
, h3
, h4
, h5
, h6
, p
, div
, address
, fieldset
Are allowed as child elements and may also have elements input
, and label
as their children (although most of them are not semantically appropriate). In the meantime, there is no need to know about it. ”
source to share
Labels and inputs must be inside the field set. Or create a second / third filedset to enclose them separately.
eg:
<form id="youtube-form" method="post" action="">
<fieldset id="youtube">
<label for="searchField" id="label-youtube-id">YouTube ID:</label>
<input type="text" id="searchField" name="videoid" class="search-field" />
</fieldset>
<fieldset id="outputFieldset">
<legend>Output format:</legend>
<label for="flv">FLV</label>
<input type="radio" id="flv" name="format" class="radio-button" value="flv" />
<label for="avi">AVI</label>
<input type="radio" id="avi" name="format" class="radio-button" value="avi" />
<label for="mp3">MP3</label>
<input type="radio" id="mp3" name="format" class="radio-button" value="mp3" />
</fieldset>
<fieldset id="submit">
<input id="youtube-submit" type="submit" name="submit" value="Submit" />
</fieldset>
</form>
source to share