I have the following code where I try to check if A, ...., Å checkboxes are checked A2,......, ޴ text field also should be filled. If any of textboxes is not field code user shoul receive please, type text.
I am not good in JavaScript and hope someone will help me. I can not find mistake in code. Also what is interesting for is it possible to do the same thing without declaring second array?
<script language="JavaScript" type="text/javascript">
<!--
function checkform ( form )
{
var letters=new Array("A", "B", "C", "D","E", "F", "G", "H","I", "J", "K", "L",
"M", "N", "O", "P","Q", "R", "S", "T","U", "V", "W", "X",
"Y", "Z", "Æ", "Ø", "Å");
var letters2=new Array("A2", "B2", "C2", "D2","E2", "F2", "G2", "H2","I2", "J2", "K2", "L2",
"M2", "N2", "O2", "P2","Q2", "R2", "S2", "T2","U2", "V2", "W2", "X2",
"Y2", "Z2", "޾", "ࡲ", "޴");
// ** START **
for (i=0;i<=29;i++){
if (document.myform.letters[i].checked == true) && (form.letters2[i].value == ''){
alert( Please, fill in all required textboxes );
form.A2.focus();
return false ;
}
}
// ** END **
return true ;
}
//-->
</script>


