• Hi there,

    When I submit a form and have an invalid field, CF7 do an ajax call and returns:

    {“into”:”#wpcf7-f1540-p27-o1″,”status”:”validation_failed”,”message”:”One or more fields have an error. Please check and try again.”,”invalidFields”:[{“into”:”span.wpcf7-form-control-wrap.message”,”message”:”Your basket is empty”,”idref”:null}]}

    I have 2 questions:

    1/ Is there a way to get the value “Your basket is empty” in JS ? I need to detect this value in JS to open a modal popup.

    According to your documentation https://contactform7.com/dom-events/ I have tried DOM event but I do not find this value in the console.log(e)

    $(‘.wpcf7’).on(‘wpcf7invalid’, function (e) {
    console.log(e);
    });

    2/ Other solution, can I add a custom value like this and detect it ?

    {“into”:”#wpcf7-f1540-p27-o1″,”status”:”validation_failed”,”message”:”One or more fields have an error. Please check and try again.”,”invalidFields”:[{“into”:”span.wpcf7-form-control-wrap.message”,”message”:”Your basket is empty”,”idref”:null,”MYCUSTOMKEY”:”MYCUSTOMVALUE”}]}

    Best regards,
    Jér?me

    • This topic was modified 7 years, 2 months ago by Kreeger.
    • This topic was modified 7 years, 2 months ago by Kreeger.
  • The topic ‘Dom event ‘wpcf7invalid’ : how to get the error message ?’ is closed to new replies.