SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Doctype: strict vs transitional....

    Hey all.

    Don't know if this is the correct forum for this, but it has to do with layout so here goes.

    Which is better for doctype, strict or transitional? I'm trying to use strict to keep from using deprecated code but I'm getting the following error on all my hidden fields:

    Line 214, Column 53: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.

    <input type="hidden" name="psort" id="psort" value="">



    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


    The code block is below:
    HTML Code:
    <form name="mainForm" id="mainForm" method="POST" action="">
    <input type="hidden" name="psort" id="psort" value="">
    <input type="hidden" name="prowid" id="prowid" value="">
    <input type="hidden" name="prevrowid" id="prevrowid" value="">
    <input type="hidden" name="prevrowcolor" id="prevrowcolor" value="">

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,782
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Transitional is basically like saying "ok your drunk we will let you slide on some of the errors" but strict is like saying "I think your sober so NO ERRORS". Strict is best to keep completely valid pages so keep with strict. Transitional DTD's should only be used whilst in transitional periods. All you need to do to fix that error is wrap the <input> in one of those tags listed above in the error.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your using XHTML 1.0 strict, remove the name attribute from the form element.
    Jaysone

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And i also think that attribute values in XHTML should be in lowercase. I notice that the method attribute in your form element is set to POST instead of post.
    Jaysone

  5. #5
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The main reason for this error is a form must directly contain a block level element - usually a fieldset.

  6. #6
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Centauri View Post
    The main reason for this error is a form must directly contain a block level element - usually a fieldset.
    I totally forgot about including the fieldset.

    Is this for strict or transitional?
    Jaysone

  7. #7
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Strict, but it's always a good idea, and besides, transitional is meant for those documents coming from a pre-HTML 4.01 setting (or era, or age, or whatever you want to call it) "making the transition" to modern markup.

    If you're starting off with a new Web page, then go with a Strict DOCTYPE.

    (Oh, and I also moved this thread to the HTML/XHTML board.)

  8. #8
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a normal requirement for a form, and will not validate with a strict doctype without it.

  9. #9
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks alot everyone
    Jaysone


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •