Hi Im trying to use jquery plug in live validation combined with a PHP random math generator for a captcha. I can get the random math to work with jquery.validate.js, but need to add in the valid email function of livevalidation.js
I can't seem to get the syntax right matching a value to a php value. Here is the PHP that generates the random math,
<?php
$randomNum = rand(0,9);
$randomNum2 = rand(0,9);
$randomNumTotal = $randomNum + $randomNum2;
?>
and this is the syntax Im trying to use to get it to validate to the input #math
$("#math").validate({
expression: "if (VAL == <?php echo $randomNumTotal; ?>) return true: else return false;",
//plug in correct syntax...im having issues with the VAL == or any other type of matching
//expression: "if (<expression for validation>) return true; else return false;",
message: "Please check your math"
});
Im sure this is real easy for most of you, I would greatly appreciate any help.
Thanks,
Kane