xhtml and input tag outside form

Discussion in 'XML' started by Zone, Jan 22, 2008.

  1. Zone

    Zone Guest

    Hello,

    I have tried to understand why input field is valid outside form tag.
    I seems to work outside form if e.g. input tag is inserted inside div tag.

    I tried to read http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
    but didn't find any solution.

    Can anyone clearify were input is accepted if it's not inside form?

    Cheers,
     
    Zone, Jan 22, 2008
    #1
    1. Advertising

  2. Zone wrote:

    > I have tried to understand why input field is valid outside form tag.
    > I seems to work outside form if e.g. input tag is inserted inside div tag.
    >
    > I tried to read http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
    > but didn't find any solution.
    >
    > Can anyone clearify were input is accepted if it's not inside form?


    HTML 4 and XHTML 1 allow form controls outside of 'form' elements as you
    might want form controls in your HTML document for scripting or other
    reason where you do not need to submit form data to the server. On the
    other hand an old browser like Netscape 4 does not render form controls
    outside of 'form' elements but Netscape 4 is not of relevance anymore.
    As for where the DTD defines that form controls are allowed outside of
    'form' elements, the relevant definitions are as follows
    <!ENTITY % inline.forms "input | select | textarea | label | button">
    <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; |
    %inline.forms;">
    <!-- %Inline; covers inline or "text-level" elements -->
    <!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
    <!ELEMENT p %Inline;>
    that defines the contents of p elements and allows form controls
    (defined by inline.forms). There are similar definitions for other
    elements allowing form controls too.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 23, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim_Mac
    Replies:
    3
    Views:
    1,359
    Steven Cheng[MSFT]
    Dec 16, 2005
  2. shruds
    Replies:
    1
    Views:
    841
    John C. Bollinger
    Jan 27, 2006
  3. Zone
    Replies:
    10
    Views:
    852
    dorayme
    Jan 24, 2008
  4. André
    Replies:
    2
    Views:
    739
    André
    Jun 23, 2008
  5. john woo
    Replies:
    1
    Views:
    152
    David Dorward
    Jun 29, 2005
Loading...

Share This Page