banging my head against the wall for something seemingly dead simple.
Here it is:
<html>
<head></head>
<body>
<form method="post" action="action.php">
<div><input type="checkbox" name="test" value="Newspaper"> <span >Newspaper</span></div>
<div><input type="checkbox" name="test" value="PC"> <span >PC</span></div>
<div><input type="checkbox" name="test" value="Home"> <span >Home</span></div>
<div><input type="checkbox" name="test" value="Dont_know"> <span >dnunno</span></div>
<input type="submit" name="Submit" value="send">
</form>
</body>
</html>
But when i select more then one option. I see in my print_r($_POST) statement only the last selected option in stead of all selected options. How should I deal with this?
update: I checked the rest of my code and i saw that this is done by some javascript.
else if(aform.validatorArr[i][4]=="checkbox"){
var fvs="";
eval("var chkbArray=aform."+aform.validatorArr[i][1]+";");
if(aform.validatorArr[i][2] =="cb_true"){
for (k=0;k<chkbArray.length;k++)
{
if (chkbArray[k].checked)
{
fvs+=chkbArray[k].value;
console.log(fvs);
}
}
if (fvs == false)
{
s+=aform.validatorArr[i][3]+"\n";
}
}
}
thats why the [] is not added in my html. But how could I modify this code so that it will take all options?