Hi,
I noticed that another site had validation added onto Radio Buttons, and was just wondering how to add that myself?
Example: If the user selects Yes then the Validation should display. But if the user selects No then the user should be able to go the next step of the form.
This is the link I found the working example, under the Health step just select Yes: https://wmda.info/donor/become-a-donor/#gf_22
This is what I have tried so far but I am now receiving a validation for both Yes and No, which is incorrect:
add_filter( 'gform_field_validation_4_5', 'custom_validation');
function custom_validation($value){
if($result['$value'] = No){
$result['$value'] = Yes;
$result['message'] = 'Unfortunately you cannot become a blood stem cell donor.';
}
return $result;
}
Kind regards,
Dale