Home > Web Front-end > JS Tutorial > body text

How to deal with the forced refresh of the Form submission page

php中世界最好的语言
Release: 2018-04-03 09:44:43
Original
3186 people have browsed it

This time I will show you how to deal with the forced refresh of the submitted Form form page, and solve the problem of forced refresh of the submitted Form form page. What are the precautions?The following is a practical case, let's take a look .

It took me a long time to click submitButton I added a type="button" It turned out to be <form > <button id=" sub" /> Problem

//在记一个坑(刚学前台,不是很懂,项目中自己给自己挖了个坑,哈哈...)

 

When there is a button tag in the form, after the form is submitted asynchronously using ajax, the page will be refreshed. (It feels very weird) Cause: When the button exists, the form will be submitted again, so the page is refreshed. (Previously thought button type='submit'

) button has the function of submitting the form.

Solution: Just replace the button label with a label

. Modify

I believe you have mastered the method after reading the case in this article, and there will be more exciting things Please pay attention to other related articles on php Chinese website!

Recommended reading:

How to deal with ajax cross-domain access error 501

Use Ajax to increase data based on the human resources system OA account method

The above is the detailed content of How to deal with the forced refresh of the Form submission page. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!