jquery - Prevent Gravity Forms Submission With Confirmation Box -
jquery - Prevent Gravity Forms Submission With Confirmation Box -
i'm using next code output confirmation box when submit button of wordpress gravity form clicked:
$(".gform_wrapper.form-01 form").submit(function(event) { confirm('ut in nulla enim. phasellus molestie magna non est bibendum non venenatis nisl tempor. suspendisse.'); });
the popup works fine, need prevent form submitting if if user clicks 'cancel' button. regardless of button clicked in confirmation, form submitted anyway.
managed prepare myself (for once!)
$('.gform_wrapper.form-01 form input[type="submit"]').click(function(event) { event.preventdefault(); var c = confirm('ut in nulla enim. phasellus molestie magna non est bibendum non venenatis nisl tempor. suspendisse.'); if (c == true) { $(this).closest('form').submit(); } else { alert('no'); } });
jquery wordpress forms gravity-forms-plugin
Comments
Post a Comment