Possible to get jquery .serializeArray() values out by key name?
Posted
by chobo2
on Stack Overflow
See other posts from Stack Overflow
or by chobo2
Published on 2010-05-24T18:31:18Z
Indexed on
2010/05/24
19:01 UTC
Read the original article
Hit count: 117
jQuery
Hi
I am using the jquery .serializeArray() function and I send it to the server and that works all good.However I need to update a couple things on the client side that are serialized.
So instead of doing another selector on the textbox I want to just grab it out of the serialized array.
I am not sure how to do this
Product=Test&Qty=50
So say if I have something like this. I can I do something like this
var sendFormData = form.serializeArray();
var val = sendFormData["Product"].value;
but this seems not to work. I only can get it to work when I do something like this
var sendFormData = form.serializeArray();
var val = sendFormData[0].value;
I really don't want to do it by index since that means if the order changes the values could be all wrong. If you could do it by like keyname then that would not be a problem.
© Stack Overflow or respective owner