Hi @altimac
Hope this message finds you well.
After testing the Selec field on my test site, I could not reproduce the issue
The –Select– is set as a Placeholder:
https://prnt.sc/pQryR9zYkYDV
No selection no error:
https://prnt.sc/FnVDllM_Hrsy
Still, we would like to take a look at the form, could you export your form using the guide on this link: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export? Once exported, kindly use a Cloud service like Google Drive, pastebin.com, or similar to share it. If you have sensitive data, please duplicate the form, remove it, and export the form.
Best regards,
Laura
Hi, Laura and thank you for checking this. I have exported the form and placed it here:
https://media.altimac.com/sport-tour.json
No matter what I do I see the “reqiured” message, as soon as the form is loaded. Screen shot here:
https://media.altimac.com/sport-tour.png
Hi @altimac
Thanks for the form, it was really helpful.
After a couple of tests, I was able to reproduce the same on my site, the issue seems to be related to the Stripe field, after removing it the error went away.
In such a case, I escalated and reported this to our Second Line Support, and they will check closer and provide further information, since they work on very complex issues, getting a reply from them could take longer than usual. Your patience on this is greatly appreciated.
We will back to this topic once we get an update from them, in the meantime I would suggest disabling the required option from the Select field.
Best regards,
Laura
Thank you and I appreciate your looking into it.
Hi @altimac
Could you please try this script:
<?php
add_action( 'wp_footer', 'wpmudev_select_field_change_fix', 9999 );
function wpmudev_select_field_change_fix() {
global $post;
if ( is_a( $post, 'WP_Post' ) && ! has_shortcode( $post->post_content, 'forminator_form' ) ) {
return;
}
?>
<script type="text/javascript">
jQuery(document).ready(function($){
$(document).on('after.load.forminator', function(e, form_id) {
if ( form_id === '46772' ) { // Please change 46772 to your form ID.
setTimeout(function(){
var holder = $('#select-2 select');
var holderField = holder.closest( '.forminator-field' );
var holderError = '';
var errorId = holder.attr('id') + '-error';
var ariaDescribedby = holder.attr('aria-describedby');
holderError = holderField.find( '.forminator-error-message' );
// Remove or Update describedby attribute for screen readers
if (ariaDescribedby) {
var ids = ariaDescribedby.split(' ');
ids = ids.filter(function (id) {
return id !== errorId;
});
var updatedAriaDescribedby = ids.join(' ');
holder.attr('aria-describedby', updatedAriaDescribedby);
} else {
holder.removeAttr('aria-describedby');
}
// Remove invalid attribute for screen readers
holder.removeAttr( 'aria-invalid' );
// Remove error message
holderError.remove();
// Remove error class
holderField.removeClass( 'forminator-has_error' );
},500);
}
});
});
</script>
<?php
}
Please, update the 46772 by using your form ID + the $(‘#select-2 select’) to your select field number, add it as a mu-plugin https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Best Regards
Patrick Freitas
Thank you, Patrick. That did the trick! I added it using CodeSnippets, assuming that’s OK and that creating a plugin is just another way to get the code to load on the site?
Hi @altimac
Yes, the mu-plugins are a safer way to add custom code without the need to create a child theme or using the snippet plugins.
Note, that is also a bug in the plugin and we reported to our developers, we can’t give an estimate time to release the fixed version but you can keep the mu-plugin as long as you need.
Best Regards
Patrick Freitas
OK, sounds good. Thanks again for acknowledging the issue and providing a quick fix.