Sorry, maybe I can rephrase this question to be easier to answer....
Since the user-defined price number entered into the form is reformatted to $xx.xx then how do I validate that?
When I use the function with a < 25 as the if statement, it won't pass any values entered even if they are 25 and greater.
add_filter("gform_field_validation_5_1", "custom_validation", 10, 4);
function custom_validation($result, $value, $form, $field){
if($result["is_valid"] && intval($value) < 25){
$result["is_valid"] = false;
$result["message"] = "Please enter an amount of $25 or more.";
}
return $result;
}
Posted 11 years ago on Wednesday December 12, 2012 |
Permalink