Hello guys I have a question about how can I make a form that will take multiple submits. I need to make a form that doesn't refresh the page, on first sight you have to agree than to take you to the form and on submission save the data in cookies. Please understand Im new in web programming just any explanation will be appreciated. Thank you
Asked
Active
Viewed 38 times
-2
-
2Please provide us some of your code or what you have tried so far. – Marcel Wasilewski Sep 21 '16 at 10:49
-
This is a [jQuery Ajax POST example with PHP](https://stackoverflow.com/questions/5004233/jquery-ajax-post-example-with-php) – Sep 21 '16 at 10:52
-
Is it for you to interact with the server after each event taking away focus from the form fields? Read about AJAX. – simhumileco Sep 22 '16 at 20:33
-
Please explain what you mean for "multiple submits"? – simhumileco Sep 23 '16 at 06:51
2 Answers
1
You can submit a form only once. What you can do is your read your form data and submit a request via ajax (provided you have a web service that handles this) It would really help if you provide some code sample.

Nikhil Madhamshettiwar
- 299
- 3
- 5
0
I make a form that will take multiple submits
If you want to use jQuery, you can use event.preventDefault () on the submit event with the Ajax.
and on submission save the data in cookies
If you want to use cookies on the client side and you're using jQuery, you can add and use an jQuery plugin jquery.cookie for handling cookies.
Or better yet, you can use JavaScript Cookie, which is also simple and lightweight and does not require dependencies on jQuery.
But I encourage you the use of cookies on the server side.

simhumileco
- 31,877
- 16
- 137
- 115