skip to Main Content

Run script only once – Jquery ajax

I have the form like this: <form method="POST" action="bubble2.php" id="bubbleName"> <input id="myInput" name="namehere" type="text"> <input name="submit" type="submit"> </form> And the script which prevents redirecting or reloading the page after submit: <script> $(document).ready(function(){ $('form').submit(function(e){ e.preventDefault(); $.ajax({ type: 'POST', url: 'bubble.php', data:…

VIEW QUESTION

Why form is never submitted with Jquery? – Jquery ajax

My form is <form id="dataForm"> </form> the button that is clicked is <button id="btnAddSave" type="button"> ButtonText </button> and the Jquery used is $(document).ready(function () { $("#btnAddSave").click(function () { alert("1"); $("#dataForm").submit(function (e) { alert("2"); e.preventDefault(); var form = $(this); var url…

VIEW QUESTION
Back To Top
Search