hi,
i have a php page wherein i am loading few item from DB in checkbox.if the user is selecting any checkbox he has to enter related data. i.e any inspection is selected then he has to enter basis on which he would be charged [Contractual or PER SERVICE], amount and currency [INR / USD /EURO].i am stuck in the javascript validation .i am unable to complete it as when i try to alert the bold line it gives javascript error of :"document.mainform.elements[....]value" is null or not an object. IT doesnt find the basis[] object.
it goes as below:

///////////////////////////////////////////////
<script language='javascript'>
function ValidCheckbox(){
var chk=document.getElementsByName("inspectionid[]");

var frm=document.mainform;
if (chk.length>0)
{
var flag=0;
var selectflag=0;
var amtflag=0;
var currflag=0;
var j=0;

for (var k = 0; k < chk.length ; k++) {

if (chk[k].checked==true) {
j++;
flag++;

/* VALIDATION OF RELATED ITEM GOES HERE
var submenu = document.mainform.elements['basis['+0+']'].value;
alert(submenu);

*/
}
} // end of main for
} // end of it


}
</script>


<body>
<form name="mainform">
<table>
<tr>
<td><B>Inspections</B></td>
<td><B>Basis</B></td>
<td><B>Rate</B></td>
<td><B>Currency</B></td>
<?
while ($rs=mysql_fetch_assoc($rid)) {
?><tr>
<td class='newtd' width='50%'><INPUT TYPE="checkbox" NAME="inspectionid[]" value="<?=$rs['inspectionid']?>" <? if ($db->isinarray($inspectionid,$rs['inspectionid'])) { print 'Checked'; } ?>> <?=$rs['inspectionname']?>
<td width="20%" class='newtd'>
<select name='basis[]' class='sel1'>
<option value="">Select Basis </option>
<option value="Contractual">Contractual</option>
<option value="Per Unit">Per Unit</option>
</select>
<td class='newtd' width="20%"><INPUT TYPE="text" class='smtxtbox' NAME="amt[]"></td>
<td class='newtd' width="10%"> <?
$result = mysql_query("SELECT currencyid, shortname FROM currency ORDER BY currencyname ");
$out = "<select size='1' name='currencyid' class='sel1'>";
$out .= "<option value=''>Select </option>";
while ($row = mysql_fetch_assoc($result)) {
if ($currencyid==$row['currencyid']) {
$selected='selected';
} else {
$selected='';
}
$out .= '<option value="' . $row['currencyid'] . '" '.$selected.'>' . $row['shortname'] . '</option>';
}
$out .= '</select>';
mysql_free_result($result);?>
<?=$out?></td>
</tr>
<? $i++; } ?>


<? } ?>


/////////////////////////////////////////////////////////////////

Please help me
Million thanks in advance
Bhakti