I have written an ajax function where I want to display confirmation meeessage before submitting the form. How should I add with my condition. Below is my code.
ajax
Use ajax beforeSend callback function.
beforeSend: function () { if(confirm("Are you sure?")){ // do something } else { // stop the ajax call return false; } },
See documentation Ajax http://api.jquery.com/jquery.ajax/