Show submitted form response on the same page. (No Reload)

前端 未结 4 2061
野的像风
野的像风 2020-12-14 13:38

How would I go about showing the response from a submitted contact form (on the same page underneath the form) rather than sending the user to a new page after the submissio

4条回答
  •  春和景丽
    2020-12-14 14:05

    You can just keep it on the same page. For example, if your form is on contact.php, just echo your code like so:


    Of course this will reload that page. If you don't want the page to be reloaded, you need to use ajax.

提交回复
热议问题