0

I've got questionnaire page on my website using bootstrap/jquery. I have 2 forms: for person and for business and each of it has a lot of checkboxes, input elements and etc. On the backend side we await a json file which we will parse after user form be completed.

What are the best practices to build a json file according to the following situation. Should i do with pure JS script in the end of page or there is a better way to do it?

Mayank Pandeyz
  • 25,704
  • 4
  • 40
  • 59
ServerSideCat
  • 1,992
  • 3
  • 18
  • 24

1 Answers1

1

For easy use and backward compatibility you can use http://malsup.com/jquery/form/
Or pick the data one by one from the inputs you have and build the object you want to send to server, at the end send it using jQuery or convert it to json and do what you want using:

var jsonStr = JSON.stringify(myObjectFromFormInputs);
Dabbas
  • 3,112
  • 7
  • 42
  • 75