Here is my code which is wrong with a text field for phone number added:
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,2);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);
$WAFV_Errors .= WAValidateEM(((isset($_POST["Phone_number"]))?$_POST["Phone_number"]:"") . "",true,9);
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?strtolower($_SESSION["random_answer"]):"") . "",true,5);
$WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);
$WAFV_Errors .= WAValidateRX(((isset($_POST["seconddblock"]))?$_POST["seconddblock"]:"") . "","/^$/i",false,7);
$WAFV_Errors .= WAValidateRX(((isset($_POST["thirddblock"]))?$_POST["thirddblock"]:"") . "","/^$/i",false,8);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
<form action="" method="post" name="emailContact" id="emailContact" onsubmit="">
<div style="width:inherit">
<label for="Contact_Name" >Your name:</label>
<br />
<span id="sprytextfield1">
<input name="Contact_Name" type="text" class="inputValue" id="Contact_Name" onblur="if (document.getElementById('nameServerError')) document.getElementById('nameServerError').style.display='none'" value="<?php echo(ValidatedField("contact","Contact_Name")) ?>" />
<span class="textfieldRequiredMsg">A value is required.</span></span>
<input name="addblock" type="text" id="addblock" style="display:none" value="" />
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<span id="nameServerError" class="textfieldServerError">Please provide your name.</span>
<?php //WAFV_Conditional contact.php contact(1:)
}
}
}?>
<br />
<label for="Email_address" >Email Address:</label>
<br />
<span id="sprytextfield2">
<input name="Email_address" type="text" class="inputValue" id="Email_address" onblur="if (document.getElementById('emailServerError')) document.getElementById('emailServerError').style.display='none'" value="<?php echo(ValidatedField("contact","Email_address")) ?>" />
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
<input name="seconddblock" id="seconddblock" type="text" style="display:none" value="" />
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<span id="emailServerError" class="textfieldServerError">Please provide your email address so we can get back in touch with you.</span>
<?php //WAFV_Conditional contact.php contact(2:)
}
}
}?>
<br />
<label for="Phone_number" >Phone Number:</label>
<br />
<span id="sprytextfield3">
<input name="Phone_number" type="text" class="inputValue" id="Phone_number" onblur="if (document.getElementById('emailServerError')) document.getElementById('emailServerError').style.display='none'" value="<?php echo(ValidatedField("contact","Phone_number")) ?>" />
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
<input name="thirddblock" id="thirddblock" type="text" style="display:none" value="" />
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "9" . ",") !== false || "9" == "")) {
if (!(false)) {
?>
<span id="emailServerError" class="textfieldServerError">Please provide your phone number with area code so we can get back in touch with you.</span>
<?php //WAFV_Conditional contact.php contact(4:)
}
}
}?>
<br />
<label for="Comments" >Comments:</label>
<br />
<span id="sprytextarea1">
<textarea name="Comments" class="inputText" id="Comments" onblur="if (document.getElementById('commentsServerError')) document.getElementById('commentsServerError').style.display='none'" ><?php echo(ValidatedField("contact","Comments")) ?></textarea>
<span class="textareaRequiredMsg">A value is required.</span></span>
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "3" . ",") !== false || "3" == "")) {
if (!(false)) {
?>
<span id="commentsServerError" class="textfieldServerError">Please let us know how we can assist you.<br />
</span>
<?php //WAFV_Conditional contact.php contact(3:)
}
}
}?>
<br />
<label for="Security_code" >
<?php require_once("WA_ValidationToolkit/WAVT_CaptchaSecurityQuestion.php"); ?>
</label>
<br />
<span id="sprytextfield4">
<input name="Security_question" type="text" class="inputValue" id="Security_question" onblur="if (document.getElementById('securityServerError')) document.getElementById('securityServerError').style.display='none'" maxlength="40" />
<span class="textfieldRequiredMsg">A value is required.</span></span>
<p>
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "5" . ",") !== false || "5" == "")) {
if (!(false)) {
?>
<span id="securityServerError" class="textfieldServerError">Your answer was not correct.</span>
<?php //WAFV_Conditional contact.php contact(4:)
}
}
}?>
<br />
<input type="submit" value="Submit" class="inputButton"/>
</p>
<p> </p>
<p> </p>
<p> </p>
</div>
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "email", {validateOn:["blur"]});var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "ephone", {validateOn:["blur"]});
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "none", {validateOn:["blur"]});
var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {validateOn:["blur"]});