This is a question that has come up a few times on here in the past but I just can't get my head around it.
This is how my output is looking at the moment:
0 "affiliate_hoover_plugin_options[1][radioName]:mac"
1 "checked:true"
2 "affiliate_hoover_plugin_options[2][radioName]:pc"
3 "checked:false"
4 "affiliate_hoover_plugin...ons[3][radioName]:linux"
5 "checked:false"
And this is how I want it to look:
1: "affiliate_hoover_plugin_options[1][radioName]:mac", "checked:true"
2: "affiliate_hoover_plugin_options[2][radioName]:pc", "checked:false"
3: "affiliate_hoover_plugin...ons[3][radioName]:linux", "checked:false"
This is how my code looks:
var newForm = [];
for (var i = 1; i < oldForm.length; i += 1) {
newForm.push(oldForm[i].name + ":" + oldForm[i].value);
if (oldForm[i].type === "radio") {
newForm.push("checked" + ":" + oldForm[i].checked);
}
}
console.log(OnewForm);
Now I'm going to have put an extra for loop in there aren't are, which is where I'm confusing myself.
I think I just need a break