This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12714 - <input /> tag not accepted within a <form> block
Summary: <input /> tag not accepted within a <form> block
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: HEAD
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 15:21 UTC by musthave6
Modified: 2011-08-23 20:22 UTC (History)
1 user (show)

See Also:


Attachments

Description musthave6 2011-05-20 15:21:58 UTC
This HTML Code gives the following error:

document type does not allow element "input" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag

          <input type="button" name="submit" value="Login" onclick="login();" />

Regarding to W3C's own examples, an <input> tag are place within a <form> block.
The source look like this:

<form id="loginForm" action="#" method="post" style="margin: 0 auto; width: 50%">
  <fieldset>
    <legend>Inloggning</legend>
      <p><label>User:</label><input type="text" name="username" /></p>
      <p><label>Password:</label><input type="password" name="password"   onkeypress="CheckEnter()" /></p>
    </fieldset>
    <input type="button" name="submit" value="Login" onclick="login();" />
    <input type="hidden" name="challenge"    value="60e1c4c8e45f25ca4992a6ed2c5622f0795757aecb610fb3f03fe7fab39fcb10df3b47e101d0561a"/>
</form>
Comment 1 musthave6 2011-05-20 15:23:30 UTC
Might be related to issue #12706
Comment 2 Etienne Miret 2011-08-23 20:22:22 UTC
The <form> element allows only script and block level elements as children:
http://www.w3.org/TR/html4/interact/forms.html#h-17.3

However, form controls, including <input> are inline level elements:
http://www.w3.org/TR/html4/sgml/dtd.html#inline

Thus, the last two <input> in the HTML code given are invalid.