I've got an issue with Solspace Freeform whereby the required field error message is being triggered if the user chooses to go the previous page without entering any information on the current page. Is there any way to bypass this?
I already have a custom extension created which uses the freeform_module_insert_begin
hook and contained within is a conditional for submitting to a previous page. Is there a function, or something, that I can use here to bypass the required field?
<?php
function checkup_method( $inputs, $entry_id, $form_id, $obj ) {
if ( ee()->extensions->last_call !== FALSE ) {
$inputs = ee()->extensions->last_call;
}
if ( get_class( $obj ) == 'Freeform' ) {
$submit = 'submit';
if ( isset( $_POST['submit_to_previous'] ) )
$submit = 'previous';
if ( $submit == 'previous' ) {
// Custom code
}
}
return $inputs;
}
?>
Thank you.