Hello,
I am trying to setup a custom validation for the user defined price. I followed this code example in the documentation and haven't been able to get it to work correctly (it returns an error no matter what). http://www.gravityhelp.com/documentation/page/Gform_field_validation
Here is an example where we need to have a minimum donation amount of $3,000: http://templedavid.org/jason-z-edelstein-endowment-fund-bricks/
My code in functions.php:
add_filter("gform_field_validation_12_1", "custom_validation3", 10, 4);
function custom_validation3($result, $value, $form, $field){
if($result["is_valid"] && intval($value) < 3000){
$result["is_valid"] = false;
$result["message"] = "You must donate at least $3,000 to be eligible for a brick.";
}
return $result;
}
Any ideas on how I can make this work? Maybe it has something to do with the field being a dollar amount?
Thanks!