I have a form, form 9, with two date fields, 18 and 11. I want to check, when the entry is updated (I am using GravityView), to make sure that date 11 is not before date 18.
I have this code, but it’s only referencing looking at 18 to make sure it’s not the same as 11, not looking at before.
add_filter( ‘gform_field_validation_9_18’, function ( $result, $value, $form, $field ) {
$master = rgpost( ‘input_9_11’ );
if ( $result[‘is_valid’] && $value == $master ) {
$result[‘is_valid’] = false;
$result[‘message’] = ‘Return date is before Start date.’;
}
return $result;
}, 9, 1 );
Anyone tackled this type of thing before? Thanks in advance!