Jump to content


XHTML 1.1 Forms


2 replies to this topic

#1 raenef

    Code Enforcer

  • Members
  • PipPipPip
  • 540 posts
  • Location:Battle Creek, Michigan
  • Interests:Web Development and Graphic Design

Posted 09 July 2005 - 10:23 PM

Ok, so Im having a little trouble getting this shout-board form validated:
My Results

Heres the code its choking up on:
	<form id="shoutbox" method="post" action="shoutbox.php">
Name:<br />
	<input type="text" name="name" maxlength="255" /><br />
E-mail:<br />
	<input type="text" name="email" maxlength="255" /><br />
Message:<br />
	<input type="text" name="post" /><br />
	<input type="submit" name="shoutsubmit" value="Submit" />
	<input type="reset" name="reset" value="Clear" />
	</form>

Any help would greatly be appreciated.

Edited by raenef, 09 July 2005 - 10:34 PM.


#2 /quit

    P2L Che

  • Members
  • PipPipPipPip
  • 1,016 posts
  • Gender:Male
  • Location:New Hampshire

Posted 09 July 2005 - 10:42 PM

Well for one thing, I would not even use br, instead use <p>&nbsp;</p> that may free up some of your problems and make the task less daunting.

#3 raenef

    Code Enforcer

  • Members
  • PipPipPip
  • 540 posts
  • Location:Battle Creek, Michigan
  • Interests:Web Development and Graphic Design

Posted 09 July 2005 - 10:55 PM

That spaced everything out all funny, and validated about the same. So I changed it back :lol: thanks for the try though.

Also as a sidenote for those viewing in the future: I know it'd probably work in a HTML doctype but its a goal of mine to get everything validated xhtml 1.1 :o


Edit: Figured it out and thought I'd share here for those of you that may be having the same trouble, or might have in the future.
The above form code I was using was correct: However for some reason in XHTML 1.1 you cannot have your forms within a div. Example:

The wrong code:
<div id="contentbox"><div>
<form id="shoutbox" method="post" action="shoutbox.php">
Name:<br />
<input type="text" name="name" maxlength="255" /><br />
E-mail:<br />
<input type="text" name="email" maxlength="255" /><br />
Message:<br />
<input type="text" name="post" /><br />
<input type="submit" name="shoutsubmit" value="Submit" />
<input type="reset" name="reset" value="Clear" />
</form>
</div></div>

To correct it so it validates I had to put it like:
<form id="shoutbox" method="post" action="shoutbox.php">
<div id="contentbox"><div>
Name:<br />
<input type="text" name="name" maxlength="255" /><br />
E-mail:<br />
<input type="text" name="email" maxlength="255" /><br />
Message:<br />
<input type="text" name="post" /><br />
<input type="submit" name="shoutsubmit" value="Submit" />
<input type="reset" name="reset" value="Clear" />
</div></div>
</form>

Edited by raenef, 10 July 2005 - 12:36 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users