Jquery submit form broken

后端 未结 6 1030
伪装坚强ぢ
伪装坚强ぢ 2021-01-26 04:45

I tried stop form refreshing the page but it refreshes page every time i submit the form.



        
6条回答
  •  南方客
    南方客 (楼主)
    2021-01-26 05:03

    This is a common problem, and is easily solved.

    Just get rid of the

    tags and instead use:

    Then create a submit() method in Javascript that performs the desired operations.

    This stops the form from posting back to the page.

    If you need to POST the data somewhere, use JQuery's .post() method in the submit() method:

    http://api.jquery.com/jQuery.post/

提交回复
热议问题