Link to home
Start Free TrialLog in
Avatar of chrisfixit
chrisfixit

asked on

XHTML Form problem..

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!! :-)
Avatar of Bardobrave
Bardobrave
Flag of Spain image

Can't you simplify our work a bit and let us know what errors told you the parser your page has?
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.
Avatar of chrisfixit
chrisfixit

ASKER

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 :-).
ASKER CERTIFIED SOLUTION
Avatar of Designbyonyx
Designbyonyx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
had to modify recapchalib as well as it is non-compliant.
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.
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.