?
Solved

XHTML Form problem..

Posted on 2011-02-24
9
Medium Priority
?
309 Views
Last Modified: 2012-05-11
I tried validating my Contact page for DTD XHTML 1.0 Strict

and it really doesn't like my Form :-)

 
<form action="contact.php" method="post" name="benq" >
<label class="sel"  for="Name">Name:</label>
<input class="seli" name="name" type="text" id="name" size="35" maxlength="50"
                    value="<? echo $_POST['name']?>">
					<div class='info' id="inf_name"><? echo $namerr ?></div>
                    <br />

<label class="sel"  for="Email1">Email Address:</label>
<input class="seli" name="email1" type="text" id="email1" size="35" maxlength="50"
                     value="<? echo $_POST['email1']?>">
					<div class='info' id="inf_email1"><? echo $email1err ?></div>
                    <br />
					
<label class="sel"  for="Email2">Confirm Email:</label>
<input class="seli" name="email2" type="text" id="email2" size="35" maxlength="50"
                     value="<? echo $_POST['email2']?>">
					 <div class='info' id="inf_email2"><? echo $email2err ?></div>

                    <br />
					
<label class="sel"  for="Enquiry">Enquiry:</label>
<textarea name="enquiry" id="enquiry" class="seli" rows="3" cols="40"
 				 ><? echo $_POST['enquiry']?></textarea>
 <fieldset> 				    <div class='info' id="inf_enq"><? echo $enqerr ?></div>
                    <br />
                   
<label></label><div id="security"><? require_once('recaptchalib.php');
$publickey = "6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxudKFagv9pQ8J2"; // you got this from the signup page
echo recaptcha_get_html($publickey); ?>
</div>
                  
<label></label>     <div class='info' id="inf_name"><? echo $imagerr ?></div>
                    <br />
					
<label></label>	  										
<input class='brk' type="submit" name="submit" value="Send">
<input class='brk' type="reset" value="Clear Form">
  </fieldset>
<br>
</form>

Open in new window


Help!! :-)
0
Comment
Question by:chrisfixit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 19

Expert Comment

by:Bardobrave
ID: 34971233
Can't you simplify our work a bit and let us know what errors told you the parser your page has?
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 34971302
If you are copying and pasting code into the validator, then remember that you can't validate php code.  You see all of the <? ... ?> code snippets... that's PHP code.  

You have to pull up that PHP page in a browser window, view source, copy that code, and validate it.
0
 
LVL 1

Author Comment

by:chrisfixit
ID: 34971478
a few of the errors... the rest are similar..

Line 64, Column 47: there is no attribute "name"
<form action="contact.php" method="post" name="benq" >

Line 65, Column 31: document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
<label class="sel"  for="Name">Name:</label>

Line 67, Column 29: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
                    value="">

Line 69, Column 26: 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
                    <br />
¿
The mentioned element is not allowed to appear in the context in which you've placed it;

Line 71, Column 33: document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
<label class="sel"  for="Email2">Email Address:</label>

The page was validated from the server, not copy and paste :-).
0
Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

 
LVL 14

Accepted Solution

by:
Designbyonyx earned 2000 total points
ID: 34971858
Wrap everything in your form with a div, or even more semantic use a "fieldset" and post back the results.  If you can provide a url, that would help ;)

<form>
<fieldset>
....Existing content....
</fieldset>
</form>
0
 
LVL 1

Author Closing Comment

by:chrisfixit
ID: 34972143
had to modify recapchalib as well as it is non-compliant.
0
 
LVL 19

Expert Comment

by:Bardobrave
ID: 34972144
Add the <fieldset> inside the <form> for comply with hyerarchical structure of forms.

Also, <form> tag seemly doesn't have a "name" attribute, use "id" attribute instead.

If you continue receiving errors after that paste them here.
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 34972217
Form tag DOES have a name attribute:

http://www.w3schools.com/tags/att_form_name.asp
0
 
LVL 1

Author Comment

by:chrisfixit
ID: 34972385
Well it doesn't like the name tag at all.. I went on this..

http://www.pixelmill.com/support/support_article.aspx?ParentListID=al1095&articleid=kb101700
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 34972656
toche my friend.  I personally use IDs and stopped using Name attributes years ago... so I have never encountered this error since I switched to XHTML.  Thanks for the clarification.
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question