Here i am posting this script .. I wanted to know how to get values from this multiple checkbox list into myysql table . I am using PHP + MySQL.
this is the html part
Choose a Category:
Choose Subcategory:
Choose Subcategory:
the javascript part .js


Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 5, 2016, 11:49 PM EDT
If you want PHP to treat
$_GET['select2']as an array of options just add square brackets to the name of the select element like this:Then you can acces the array in your PHP script
echo $selectedOption."\n";
$_POSTdepending on theDipankar BiswasRank #992 · 2K reputationPosted May 6, 2016, 1:19 PM EDT
Sayuj Raghavan46 reputationPosted May 6, 2016, 2:25 AM EDT
here slct2 is id not name . I need to use name for fetching selected values from second multivalues check list know ?
if (optionArray.hasOwnProperty(option)) {
var pair = optionArray[option];
var checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.name = pair;
checkbox.value = pair;
s2.appendChild(checkbox);
var label = document.createElement('label')
label.htmlFor = pair;
label.appendChild(document.createTextNode(pair));
s2.appendChild(label);
s2.appendChild(document.createElement("br"));
}
}