This is on a multi-page form. validating yes & no questions. It is jumping forward & breaking the flow of the form, how can I check if we are on the current page:
//check if binary field is required specific value
foreach ( $form['fields'] as $field ) {
if ( 'gf_require_yes' == $field->cssClass ) {
if ( 'yes' != strtolower( $_POST[ 'input_'.$field->id ] )){
$field->failed_validation = true;
$field->validation_message = 'To submit a successful application, you must answer Yes to this question';
$validation_result['is_valid'] = false;
}
}
if ( 'gf_require_no' == $field->cssClass ) {
if ( 'no' != strtolower( $_POST[ 'input_'.$field->id ] )){
$field->failed_validation = true;
$field->validation_message = 'To submit a successful application, you must answer No to this question';
$validation_result['is_valid'] = false;
}
}
}