validations not working
Hi Jason
On that page we were discussing on skype earlier, I have set up server validations as per this code: (also image1 attached)
<?php
if (isset($_POST["add"]) || isset($_POST["add_x"])) {
$WAFV_Redirect = "clientarea-update.php";
$_SESSION['WAVT_clientareaupdate_502_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Item"]))?$_POST["Item"]:"") . "",false,1);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Description"]))?$_POST["Description"]:"") . "",false,2);
$WAFV_Errors .= WAValidateNM(((isset($_POST["Cost"]))?$_POST["Cost"]:"") . "",0,100000,"",",.",true,3);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"clientareaupdate_502");
}
}
?>
This works fine in redirecting the user to the page if one of the 3 fields is empty.
I then added 3 different validation show ifs (as per image 2, 3 and 4) with this code:
<?php
if (ValidatedField('clientareaupdate_502','clientareaupdate_502')) {
if ((strpos((",".ValidatedField("clientareaupdate_502","clientareaupdate_502").","), "," . "1" . ",") !== false || "1" == "")) {
if (!((strpos((",".ValidatedField("clientareaupdate_502","clientareaupdate_502").","), "," . "1" . ",") !== false || "1" == ""))) {
?>
<div style="clear:both;color:#F00;">Please enter a valid 'item' entry</div>
<?php //WAFV_Conditional clientarea-update.php clientareaupdate_502(1:1)
}
}
}?>
Now the error statement does not show when you go to the page but non of them display if there is an error
I have tried god knows how many ways it could be, but I am lost as to what I have done wrong.
Many thanks
Jamie