Do not clear inputs after sending

Is there any trick to store input after Form.submit(); Or should I fill it out manually?

Form.submit(); clears all fields

+4
source share
3 answers

The form will be cleared by default when the page refreshes.

Here are a few things you could do:

  • use ajax to submit your form to the server, thereby eliminating the refresh page
  • re-bind data to server-side form fields after Processing
  • There are other options, but I try to be brief.
+3
source

You must fill it out. However, I do not think that you can do this using Javascript, since the form data is sent to the server.

0
source

Use simple serialize () to get the url and then use ajax post or get as you wish. Here are the links to help you:

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

http://api.jquery.com/serialize/

0
source

All Articles