How To Store Input Type Checkbox Into Json Object Using Either Javascript Or JQuery?
I wanted to store all my clicked input accordions() into json object, I have tried it but it is storing/taking the last input accordion clicked event o
Solution 1:
Because you are doing submitButtonValue[name] = $(this).val();
and the name you are getting it from $(this).attr('name');
on click of checkbox
which is same for all the checkboxes
. So everytime it replaces the value since object
will have only one name contained. I would suggest you to either use different names for each checkbox
or find some other way to uniquely store your checkbox
values.
Post a Comment for "How To Store Input Type Checkbox Into Json Object Using Either Javascript Or JQuery?"