Basit görünüşte ölü şey için kafamı duvara vurarak.
İşte:
<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";
}
}
}
[] Benim html eklenmez yüzden. Tüm seçeneklerini alacaktır böylece Ama nasıl bu kodu değiştirebilir?