Is there some kind of trick t开发者_StackOverflow中文版o keep input data after Form.submit();
Or must I fill it manually?
Form.submit();
clears all fields
The form will clear by default when the page refreshes.
There's a couple of things you could:
- use ajax to post your form to the server, thus eliminating the page refresh
- re-bind the data to the form fields on the server side after processing
- there's other options too but i'm trying to be brief
You have to fill it in. however, I do not think you can do this with Javascript since form data is posted to the server.
Use the simple serialize() to get the url and then use the ajax post or get as you wish. Here are the links which will help you:
http://api.jquery.com/jQuery.post/
http://api.jquery.com/serialize/
精彩评论