Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Why is this form not passing validation?!
Old 06-11-2008, 02:57 PM Why is this form not passing validation?!
Average Talker

Posts: 15
Name: Kyle
Trades: 0
So I have a simple form I'm including on a page:

Code:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Text</title>
</head>
<body>
<form action="something.php" method="post" enctype="text/plain" id="suggestion">
  <p class="form">Name: </p><br />
  <input type="text" id="name" size="30" /><br />
  <p class="form">Email: </p><br />
  <input type="text" id="email" size="30" /><br />
  <p class="form">Suggestions:</p><br />
  <textarea rows="%%%%" cols="30" id="suggestions" /><br />
  <input type="submit" value="Submit" />
</form>
</body>
</html>
When I try to validate it, W3C says I'm not allowed to have any of those tags inside the form tag.

Quote:
Line 9, Column 33: document type does not allow element "br" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
<p class="form">Name: </p><br />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>").
It had that 10 times for each tag in there. Any help?
kmoore11 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-11-2008, 02:58 PM Re: Why is this form not passing validation?!
nyef's Avatar
Ultra Talker

Posts: 265
Name: Lucas
Trades: 0
Move the <br /> tag to be INSIDE the </p> tag (to the left of it).
Or get rid of them completely and change the "form" css class to have "display:block;" or "clear:right;".
__________________
~nyef

Please login or register to view this content. Registration is FREE

Last edited by nyef; 06-11-2008 at 03:03 PM..
nyef is offline
Reply With Quote
View Public Profile Visit nyef's homepage!
 
Old 06-11-2008, 03:28 PM Re: Why is this form not passing validation?!
Average Talker

Posts: 15
Name: Kyle
Trades: 0
Fixed. Thanks!
kmoore11 is offline
Reply With Quote
View Public Profile
 
Old 06-11-2008, 09:47 PM Re: Why is this form not passing validation?!
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
Why do you have br tags too?
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-11-2008, 10:00 PM Re: Why is this form not passing validation?!
nyef's Avatar
Ultra Talker

Posts: 265
Name: Lucas
Trades: 0
Maybe to have extra vertical spacing between lines. Better done with css "margin-bottom:10px"
__________________
~nyef

Please login or register to view this content. Registration is FREE
nyef is offline
Reply With Quote
View Public Profile Visit nyef's homepage!
 
Old 06-12-2008, 04:25 AM Re: Why is this form not passing validation?!
northbeach23's Avatar
Ultra Talker

Posts: 379
Trades: 0
DOnt use <br> tags, make it in CSS instead
northbeach23 is offline
Reply With Quote
View Public Profile
 
Old 06-12-2008, 03:40 PM Re: Why is this form not passing validation?!
Average Talker

Posts: 15
Name: Kyle
Trades: 0
Yeah, I took those out. I don't know why I put them in there.
kmoore11 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Why is this form not passing validation?!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 2.28138 seconds with 12 queries