Hi @itsmir
I hope you are doing well today.
I pinged our Forminator & SLS Team to review your query to see what will be possible in this matter. We will post an update here as soon as more information is available.
Kind Regards,
Kris
Thread Starter
itsmir
(@itsmir)
Hiya, client has changed requirements & we no longer need this so I’ve marked it resolved. Thanks for your time.
Hi @itsmir
Just as a refer for you and future queries this is the code which you can use as a mu-plugin
add_filter( 'forminator_custom_form_submit_errors', 'wpmudev_limit_email_submission', 9999, 3 );
function wpmudev_limit_email_submission( $submit_errors, $form_id, $field_data_array ) {
if ( $form_id != 6 ) { //Please change the form ID
return $submit_errors;
}
$submitted_data = wp_list_pluck( $field_data_array, 'value', 'name' );
if ( ! empty( $submitted_data['select-1'] ) && ! empty( $submitted_data['email-1'] ) ) {
if ( $submitted_data['select-1'] == $submitted_data['email-1'] ) {
$submit_errors[]['email-1'] = __( 'E-Mail Not Allowed.', 'forminator' );
}
}
return $submit_errors;
}
This snippet should help. 6 should be changed to your form ID and select-1, email-1 should be changed to your select field and email field’s ID.
A guide to implement below code as a mu-plugin on your site https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Kind Regards,
Kris
Thread Starter
itsmir
(@itsmir)
Brilliant- thank you. I’ll add it to my snippet bank 🙂
And in the likelihood my client changes their minds again it’ll be in hand.
-
This reply was modified 3 years, 1 month ago by
itsmir.