Muiter Posted May 20, 2018 Share Posted May 20, 2018 Any suggestions please ow to change the code below because I would like yo use the standard browser validation. Quote <script type="text/javascript"> $(document).ready(function () { $(".edit_table_1").on('click', function() { formid=($(this).attr("alt")); subform_edit_table_1(formid); }); }); function subform_edit_table_1(formid) { var postData = $("#edit_table_1"+formid).serializeArray(); var formURL='includes/adres_edit_proces.php'; $.ajax({ url: formURL, type: "POST", data: postData, success: function(data, textStatus, jqXHR) { $('#modal_edit_table_1'+formid+' .modal-body').html(data); $("#submit_edit_table_1"+formid).remove(); $("#submit_edit_table_1_2nd"+formid).remove(); }, error: function(jqXHR, status, error) { console.log(status + ": " + error); } }); e.preventDefault(); } </script> Quote <button type="button" class="btn btn-info edit_table_1" id="submit_edit_table_1'.$i.'" alt="'.$i.'">Bewerk</button> Link to comment Share on other sites More sharing options...
Ingolme Posted May 20, 2018 Share Posted May 20, 2018 The browser will do validation if you use the <form> element's submit event. Do not use the click event. Link to comment Share on other sites More sharing options...
Muiter Posted May 21, 2018 Author Share Posted May 21, 2018 15 hours ago, Ingolme said: The browser will do validation if you use the <form> element's submit event. Do not use the click event. Can you please explain this? I am not that familiar with JS. Link to comment Share on other sites More sharing options...
Ingolme Posted May 21, 2018 Share Posted May 21, 2018 You probably should go through the Javascript tutorial and become familiar with it. If there's still something you need help with after that then you can ask about it here. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now