How can I serialize form state in Javascript/jQuery between AJAX requests?
I know how to serialize a form:
$("#attributeform").serialize()
but I want to store this in some kind of variable, like a hash, so that开发者_StackOverflow社区 I can retrieve these values and resubmit them in order to transition between states.
I think you are looking for serializeArray instead. It produces an array where you can save and edit.
Actually I was able to use a simple hashtable for this. I didn't want to mess with serializeArray because I was actually looking not to hash the form values, but to hash the serialized form to ANOTHER value. Sorry if I wasn't clear.
精彩评论