• Resolved andreu

    (@andreu)


    Hi,

    I’m loading content via JSON into a select2 field depending on another select field created with Contact Form 7.

    How can I make this dynamic select2 field to be required? I’m creating it from a required text field, but the required feature doesn’t keep in the select2 field.

    I was trying to add some custom JS via “on_submit” additional setting. Is it possible to check if a field is empty or not before submitting via JS? How can I make the submission stops before sending the email and display a custom error with JS?

    Thanks!

    https://wordpress.org/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • Thread Starter andreu

    (@andreu)

    Hi again,

    I could control this with jQuery, this way:

    $('form').submit(function(){
        //check validation and if the field is not correct, return false;
    });

    I could not make it work with “on_submit” setting, but seems to work fine anyway.

    Hope this helps somebody else!

Viewing 1 replies (of 1 total)
  • The topic ‘Validate external field before submit’ is closed to new replies.