-2

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

Marco
  • 11

2 Answers2

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.

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