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 MohankumarPosted May 6, 2016, 3:49 AM
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 BiswasPosted May 6, 2016, 5:19 PM
Sayuj RaghavanPosted May 6, 2016, 6:25 AM
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"));
}
}