Update form using Ajax, PHP, MYSQL

后端 未结 3 1252
一个人的身影
一个人的身影 2021-01-19 11:10

I found a tutorial that auto submits the form data but all I want to do is add a submit button to pass the data to ajax.

My goal is to have a form with multiple inp

3条回答
  •  迷失自我
    2021-01-19 11:41

    Instead of:

    $(".submit").click(function() {
    

    Give your form a id like 'myform':

    And use this for preventing default submission of form:

    $("#myform").submit(function(e) {
     e.preventDefault();
     //your code
    }
    

提交回复
热议问题