0

I'm trying to get the form data from my form returned as a simple map Object {a: "b", c: "d"}

I know I can .serialize() and .serializeArray() and then do it myself. Isn't there a jQuery function or something vailable for that?

3
  • Please provide some code Commented Jun 21, 2013 at 14:40
  • 1
    No, there isn't. $.map and $.serializeArray both return arrays rather than objects (it's called an object, not a map). The only option is looping over the fields using either a for loop while loop or an each loop. Commented Jun 21, 2013 at 14:41
  • Have you check this : stackoverflow.com/questions/1184624/… Commented Mar 26, 2018 at 8:01

1 Answer 1

1

There is no straight conversion form formdatato JSON. But here is a way to solve the problem: http://blog.erdemagaoglu.com/post/1231059494/serialize-form-data-to-json-with-jquery

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.