I have been working with this validation that suit that I am trying to do with my site, but I have come across a couple of issues getting working
[ol][li]I have a drop down box which I would love to make sure that the user selects it, but when I do the validation code and go through the motions of doing the form and miss selecting the one of the drop down box still let the form submit and send the email.[br] Refer to line 15 and 22 of validation code[/li]
[li]I am trying to validate a text area , when you leave the text area blank work by telling me that “Please enter in a message”, but when I enter some text in the text area the validation still tells me “Please enter in a message” when it should be submitting the form and sending the email. I hashed out the validation which is the comment validation and let me submit and send email.[br]Refer to line 45 though to of validation code
[/li][/ol]
Can anyone tell me what going on with the code and why the drop down box isn’t working? Would love someone take a look at the code and see what can be done for me to fix it.
[php]
[/php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Sending a Technical Message</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="robots" content="noindex" />
<meta name="robots" content="nofollow" />
</head><body class="mainB" leftmargin="1" topmargin="1" bgproperties="fixed" marginwidth="0">
<?php
If(empty($errors)=== false){?>
<ol>
<?php
foreach ($errors as $error){
echo "<li>", $error,"</li>";
}
?>
</ol>
<?php
}else{
If(isset($to, $subject,$message, $headers )){
mail($to, $subject,$message );
}
}
?>
<table width="75%" align="center" border="0"><form action="" method="post" name="feedback">
<tr>
<td> <table width="88%" border="0" align="center" cellpadding="2" cellspacing="3" bordercolor="#FF0066">
<tr bordercolor="#FF00FF">
<td align="right"><label for="name" class="dateFormFieldNames">Name</label><br><font class="red">Required</font></td>
<td width="79%"><input name="name" id="name" size="16" maxlength="16" class="select2" placeholder="Enter your name" />
</td>
</tr>
<tr bordercolor="#FF00FF">
<td width="21%" align="right"><label for="siteArea" class="dateFormFieldNames">Site earea</label><br><font class="red">Required</font></td>
<td colspan="3"> <div>
<select name="siteArea" id="siteArea" class="select">
<option value=" " selected>Select Site
Area</option>
<option value="My Full Bio">My Full Bio</option>
<option value="Image Gallary">Image Gallary</option>
<option value="Send me a message">Send me a message</option>
<option value="Techical Issues">Techical Issues</option>
</select>
</div>
</td>
</tr>
<tr>
<td align="right"><label for="problem" class="dateFormFieldNames">Problems</label><br><font class="red">Required</font></td>
<td colspan="3"><div>
<select name="problem" id="problem" class="select">
<option selected>Select the Problem</option>
<option value="A Broken link">A Broken link</option>
<option value="Page(s) missing">Page(s) missing</option>
<option value="Photo(s) missing">Photo(s) missing</option>
<option value="Link(s) not working">Link(s) not working</option>
<option value="other">>other</option>
</select>
</div></td>
</tr>
<tr bordercolor="#FF00FF">
<td align="right" bordercolor="#FF00FF" ><label for="email" class="dateFormFieldNames">Email Address</label><br><font class="red">Required</font></td>
<td colspan="3"><input name="email" type="text" id="email" class="email" placeholder="Enter your email address" /></td>
</tr>
<tr>
<td rowspan="2" align="right"><label for="explenation" class="dateFormFieldNames">Explenation</label><br><font class="red">Required</font></td>
<td colspan="3">Please explain in further detail what the problem
maybe and where it is or I have not listed any of the problems
above. Please tell me what they are </td>
</tr>
<tr>
<td colspan="3"><textarea name="comment" cols="50" rows="5" id="explenation" placeholder="Enter in your best explaination to where the problem is and what the problem is"></textarea> </td>
</tr>
<tr bordercolor="#FF00FF">
<td colspan="4" align="center" valign="middle" ><input type="submit" name="submit" value="Submit" onclick="age()" />
</td>
</tr>
</table>
<br>
</form>
</td></tr>
</table>
</html>
</body>