required field value
i have a form with validation toolkit.
one of the fields is set so that a value is not required, so the form is submitted if the field contents are either empty or in the required format.
what i would like to do is set the requirement based on the value in another field
for example, first field is option list, with option1 set as default.
if option 1 is selected, second field does not require a value.
if however option2 is set in my option list, second field does require a value.
the server side validation occurs within the if (isset($_POST["insert"])) {} block
is the best way to do this just to put the validate code within an if block ?
if (((isset($_POST["xxxxx"]))?$_POST["xxxxx"]:"") <> 0) {
$WAFV_Errors .= WAValidateNM(((isset($_POST["xxxxx"]))?$_POST["xxxxx"]:"") . "",0,1000000,2,",.",true,13);
} else {
$WAFV_Errors .= WAValidateNM(((isset($_POST["xxxxx"]))?$_POST["xxxxx"]:"") . "",0,1000000,2,",.",false,13);
}