I have a set of checkboxes with multiple choice allowed. I parse the set this way:
if ($("input[name='route_day']:checked").length > 0) {
$("input[name='route_day']:checked").each(function(){
if(this.value != null)
route_days_hook.push(this.value);
});
dataTrap.route_days = $.JSON.encode(route_days_hook);
}
…and pull the whole dataTrap to an AppEngine Python script via jQuery ajax. However, the Python script just bugs. If i change dataTrap.route_days value to a string instead of the JSON encoded object, everything works fine.
My question is: how can i pass a checkbox set to the script using Ajax and still be able to iterate over it on the script?
have you tried:
EDIT
if that didn’t work, maybe it’s because you are trying to convert an array object to JSON…
try this solution instead.