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?

2
  • 2
    Create a JS object and post it using JSON.stringify? Commented Nov 10, 2016 at 9:57
  • Share what have you tried till now Commented Nov 10, 2016 at 9:57

1 Answer 1

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);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.