SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Nov 2003
    Location
    Bath, U.K.
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Damn that W3C validator

    help, I have a style switcher on my site that uses a form to change the styles but the W3C XHTML validator doesn't like it.

    the validator says this:


    Line 37, column 66: document type does not allow element "form" here; missing one of "object", "applet", "map", "iframe", "ins", "del" start-tag


    what is it asking me to do? include the form in a <object> tag?


    thanks in advance

    joe
    this is the relevant code (from line 37):

    <form action="/komalley/sites/aw/statement.asp" method="post">


    <label><input title="Select Smaller Text" name="rCSS" type="radio" tabindex="2" value="awstyles1" checked="checked" />
    Small Text </label>

    <label><input title="Select larger text" name="rCSS" type="radio" tabindex="3" value="awstylesbig" checked="checked" />
    Large Text</label>
    <label><input type="submit" class="butt" tabindex="4" title="Change the size of the text" value="Change"/></label>
    </form>
    --------------------------------------------
    www.josephleech.co.uk
    --------------------------------------------

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    the INPUT tags have to be in a container

    i use P, some people use DIV
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's outside the form?

  4. #4
    SitePoint Member
    Join Date
    Nov 2003
    Location
    Bath, U.K.
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <span id="sizeoftextswitcher">
    </span>

    surrounds the form. I want to avoid a line break between different elements of the form. would just putting the action=" " within a <p> do it?

    so...

    <p><form action="/komalley/sites/aw/statement.asp" method="post">
    ...
    ...
    </p>

    would do it?

    joe
    --------------------------------------------
    www.josephleech.co.uk
    --------------------------------------------

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    no, FORM is a block element, and you cannot nest a block element inside a P

    what you want is

    <form>
    <p>
    <input ... />
    <input ... />
    </p>
    </form>

    and if you must, adjust the margin and or padding porperties of FORM and P in your style sheet
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You shouldn't nest a form inside a span - that's what the validator is complaining about.
    Line 37, column 66: document type does not allow element "form" here;
    "here" being "inside a span"


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
  •