Simple Ajax popup with a form collecting 3 fields of data, and a submit button. I can't programatically trigger the submit button though.
jQuery('#FormSubmit').click() doesn't work. Neither does
jQuery('#FormSubmit').mousedown() nor
document.getElementById("FormSubmit").click(); A real mouse click on the button works, but programmatically triggering it doesn't. It either posts the form in a non-AJAX way (page reload with post data appended to the url) or does nothing.
Anyone know the reasons why? Is there something specific to Ajax to prevent this?
Edit: Just tested triggering the submit event on the form instead, and that also posts the form in a non-AJAX way.
submit()function of form as w3schools.com/jsref/met_form_submit.aspfalseas in the post stackoverflow.com/a/48454059/4148965 to prevent window level form submit