K
karmenkrile
In html i have some question, and the answers are radio buttons ...
the names of variables in html are array ... like question[1],
question[2] ... etc.
and every question has multiple value, depending of the answer.
HTML Code:
<form action="thx.php" method=POST name=form onSubmit="return
check(this)">
In javascript i have to determinate if the question is answered, if it
is not then return false ...
Code:
function check(form) { a=0; for (i=0;i<form.question[1].length;i++){ if
(form.question[1].checked===true) {a=1;} } if (a==0) {
alert("question[1] no.1: You didn't answer the question"); return
false; } }
Everything was working fine until i changed my variables into arrays.
What is wrong now?
How javascript handle two dimensional array?
pls help
the names of variables in html are array ... like question[1],
question[2] ... etc.
and every question has multiple value, depending of the answer.
HTML Code:
<form action="thx.php" method=POST name=form onSubmit="return
check(this)">
In javascript i have to determinate if the question is answered, if it
is not then return false ...
Code:
function check(form) { a=0; for (i=0;i<form.question[1].length;i++){ if
(form.question[1].checked===true) {a=1;} } if (a==0) {
alert("question[1] no.1: You didn't answer the question"); return
false; } }
Everything was working fine until i changed my variables into arrays.
What is wrong now?
How javascript handle two dimensional array?
pls help