Forminator Form Submit Button Disabled

Forminator Form Submit Button Disabled

  • Predrag Dubajic
    • Support

    Hi NuttyCart ,

    I have imported your form on my test site and the submission worked fine right off the bat so it seems that the issue is specific to something on your site.
    Since this is a staging site could you please perform a full conflict test there by disabling your other plugins and switching to default WP theme and see if you’re able to submit the form after that?
    If you can, then activate them back one by one until the issue is back and that should tell us where the issue is coming from so we can debug it further.

    Best regards,
    Predrag

  • NuttyCart
    • The Incredible Code Injector

    Hi:

    I went ahead and did the plugin isolation test…IN PROD but the issue remained the same throughout. Can someone please have a look for me? My other form at /immigrate does NOT have that issue. So, I am curious.

    Please help!

  • Predrag Dubajic
    • Support

    Hi NuttyCart ,

    I was checking your site further and found that you have an frmt-country-custom-check.php file inside mu-plugins which seems to be affecting the Forminator behavior and causing this.

    I checked your previous tickets but I couldn’t find what this could be related to, thought there are quite a few of them so maybe I missed it.
    Do you know why this code is added and if it was added by our staff or it was developed by you or someone you hired?

    Best regards,
    Predrag

  • NuttyCart
    • The Incredible Code Injector

    Hi Predag:

    Yes, that was the problem. Thanks for fishing that out. One of your colleagues assisted me to install it. I needed to make the country field mandatory for one of the forms on the same site but forminator did not have that native function so we looked for an alternative. Apparently, the plugin applied the setting to all forminator forms such that the submit button is disabled if a country is not selected. Where that script acted dumb (lol) is that even when we did not have the country field on a form, it still would not allow submission. Again, thanks for fishing out the issue. What I did was to introduce the country field in the troubled forms and now they work well. I’ll leave it like that for now except if you can help update the script to exclude any forminator form that does not have the country field in it.

    Thanks again.

    Let me know!

  • Adam
    • Support Gorilla

    Hi NuttyCart

    Thanks for response and I’m glad to hear it’s now working for you!

    As for the “frmt-country-custom-check.php” code, I checked it and it’s injection a bit of JS to the site so making it “aware” of the fields – if there’s a country field and if it’s mandatory – would take a bit too much but if only a single form should be affected by that script then there is a simple solution.

    Assuming that the form that script should be applied to is the one on the homepage of your production site, it should suffice to add additional CSS selector that’s unique for the form.

    If you look into the code, you’ll notice that there’s a set of lines that contain

    $('.some_css_class_here

    so you’d want to adjust them all to start with “forminator-module-13048” ID.

    For example, this line

    cntryslct = $( '.custom-country .forminator-field .forminator-select2' );

    should become

    cntryslct = $( '#forminator-module-13048 .custom-country .forminator-field .forminator-select2' );
    

    The other lines are using different CSS classes but the CSS ID that you’d add and the way to do it would be the same. I’m sure you got the idea :slight_smile:

    Best regards,
    Adam