Submit a php form and display its result on div without reloading page

前端 未结 5 459
北恋
北恋 2021-02-04 22:25

First of all, thank you for your kind help.

I have tried almost everything I found on stackoverflow but I cannot get this to work.

I created a form to send a te

5条回答
  •  不知归路
    2021-02-04 23:18

    Use the the preventDefault() function so that the form doesn't do the redirection on submit. After that, use append() instead of appendTo()

    $('#contact-form').submit(function(e) {

    e.preventDefault();

提交回复
热议问题