Hi ,I have a form with two Quantities to be informed.
Qty1 and Qty2
I need to validate Qty2 not to be Greater than Qty1 ,
Any Idea to do this in PHP?
Roberto Reis
Hi ,I have a form with two Quantities to be informed.
Qty1 and Qty2
I need to validate Qty2 not to be Greater than Qty1 ,
Any Idea to do this in PHP?
Roberto Reis
You may simply put your validation code in "Row_Inserting" (for Add page) and "Row_Updating" (for Edit page), for example:
if ($rsnew["Qty2"] > $rsnew["Qty1"]) {
$this->setFailureMessage("Qty2 cannot be greater than Qty1");
return FALSE;
}
Read also "Server Events and Client Scripts" topic from PHPMaker help file.
Also, you may use Form_CustomValidate for client script to validate your input. See Server event and Client script (Form_CustomValidate example in Client Scripts) in help file.
If you use PHP to validate, make sure you have enabled Server Side Validation, see PHP Settings in help file.