Javascript Get Values from Multiple Select Option Box
The for loop is getting one extra run. Change for (x=0;x<=InvForm.SelBranch.length;x++) to for (x=0; x < InvForm.SelBranch.length; x++)
The for loop is getting one extra run. Change for (x=0;x<=InvForm.SelBranch.length;x++) to for (x=0; x < InvForm.SelBranch.length; x++)
Following property should work fine if you are developing app for iOS5.0+ self.tableView.allowsMultipleSelection = YES;
Iterate through the loop using the value in a dynamic selector that utilizes the attribute selector. var values=”Test,Prof,Off”; $.each(values.split(“,”), function(i,e){ $(“#strings option[value=”” + e + “”]”).prop(“selected”, true); }); Working Example http://jsfiddle.net/McddQ/1/