XHTML 1.0 Forms

Discussion in 'HTML & Website Design' started by Adam Hughes, Mar 5, 2008.

  1. #1
    I'm just finishing off a website, and I am doing my last page, the contact form. I am using Expression Web to create it. I am using XHTML Strict 1.0 as my language.

    I am trying to create a form, simple enough, just asks for the persons email, first name, last name and a message.

    However, Expression Web tells me off for using 'input' and 'textarea' tags. What am I supposed to use to be compliant with the guidelines? I've had a quick search around, but haven't found anything useful. Any ideas?

    Thanks
     
    Adam Hughes, Mar 5, 2008 IP
  2. Adam Hughes

    Adam Hughes Guest

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sorry, looks like I was just being blonde. Think the problem has been sorted by placing it into a paragraph tag.
     
    Adam Hughes, Mar 5, 2008 IP
  3. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Chances are you had your form input elements as direct descendants of the FORM element itself. Wrapping them inside a fieldset will take care of that problem, but IE doesn't style fieldsets very well.

    http://www.tyssendesign.com.au/articles/legends-of-style/

    Oh, and a P element is not the correct element to use as a wrapper - that's reserved for paragraphs of logical text arranged in sentences. :)
     
    Dan Schulz, Mar 5, 2008 IP
  4. Adam Hughes

    Adam Hughes Guest

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Dan, thanks, I'll sort that out later on!
     
    Adam Hughes, Mar 6, 2008 IP
  5. designh

    designh Banned

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <fieldset>
    				<legend>User Information</legend>
    				<label for="name"><span>Name</span><input type="text" name="name" id="name" /></label>
    				<label for="email"><span>Email</span><input type="text" name="email" id="email" /></label>
    				</fieldset>
    PHP:
    this is code to build form xhtml 1.0 strict compliant
     
    designh, Mar 6, 2008 IP