1

I am surprised at how much difficulty I am having with this.

I am using form.serialize to serialize a form to a string for submission using .ajax. I am also adding this string value to a hash, which I am using to manage state for enablement of the forward and back buttons.

My problem is, I need to get at these values from the serialized form via javascript, and I can't figure out how to do it. I can get the string, but it's basically a query string. Note that it is NOT ACTUALLY the query string, it is just formatted as a query string.

James Allardice
  • 164,175
  • 21
  • 332
  • 312
RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193
  • 1
    Why do you need to access the serialized values from JavaScript? The only real use of the serialization is to send it to the server. If you're using JavaScript, you have direct access to the form itself. – Matt Ball Feb 26 '11 at 19:46
  • http://stackoverflow.com/questions/1352214/serialize-unserialize-in-jquery – Emmanuel Feb 26 '11 at 19:47
  • I have to repopulate values in a hidden form from the query string in order to manage state. – RubyRedGrapefruit Feb 26 '11 at 20:25

1 Answers1

3

Have you tried JQuery.deserialize plugin? https://github.com/kflorence/jquery-deserialize

kflorence
  • 2,187
  • 2
  • 16
  • 15
Gobhi
  • 74
  • 2