This works! But another questions
Hi Ray,
Thanks for getting back to me! I was able to get working what you suggested. So what I did was put up in the header code the following.
<?php
if ((((isset($_POST["submit"]))?$_POST["submit"]:"") != "")) {
$WAFV_Redirect = "contact.php#error";
$_SESSION['WAVT_contact_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["studentName"]))?$_POST["studentName"]:"") . "",false,1);
$WAFV_Errors .= WAValidateEM(((isset($_POST["studentEmail"]))?$_POST["studentEmail"]:"") . "",true,2);
$WAFV_Errors .= WAValidatePN(((isset($_POST["dayPhone"]))?$_POST["dayPhone"]:"") . "",true,false,true,3);
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_code"]):"") . "",((isset($_SESSION["captcha_1"]))?strtolower($_SESSION["captcha_1"]):"") . "",true,4);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}
}
?>
I changed the value under WAFV redirect to the contact.php#error (I renamed it error).
So what I did was move down to each place that I wanted the anchor to appear (so that I could control where the page jumped to) and put the following conditional validation, with the same name (but different id).
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<a name="error" id="sName"></a>
<?php //WAFV_Conditional contact.php contact(1:)
}
}
}?>
I did this for all the other validations on the page (there are obviousely four of them).
My question is this, you had named your error, firsterror. Using your naming convention would I then have had to name the other anchors seconderror, thirderror and so on? Or would have left all the multiple errors as firsterror?
Is the way that I handled it by calling all my anchor names error the best way to handle multiple validations? Because as we know the user may have filled in their name, but not their e-mail and that is where I would have needed the form to jump to.
Cheers and thanks for all your help!
Martin