goutam.dutta123
Oct 4th 2007, 11:28 pm
Please help.....
My problem is that checkboxes are not checking respective textboxes empty or not.Here is my code:
function check(xform)
{
i = 0, inputs = document.xform.getElementsByTagName('input');
while (i<9)
{
if (inputs[i].type == 'checkbox' && inputs[i].checked)
{
if(document.getElementById('quan[]').value=="")
{
alert('specify the quantity');
return false;
}
}
i++;
}
}
My checkboxes are moving in a loop:
<input type="checkbox" name="chkID[]" id="chkID[]" value="<?=$rowSubjectsx['ID']?>">
Textboxes are also moving in a loop:
<input type="text" name="quantity[]" id="quan[]" size="3"/>
Please help............
My problem is that checkboxes are not checking respective textboxes empty or not.Here is my code:
function check(xform)
{
i = 0, inputs = document.xform.getElementsByTagName('input');
while (i<9)
{
if (inputs[i].type == 'checkbox' && inputs[i].checked)
{
if(document.getElementById('quan[]').value=="")
{
alert('specify the quantity');
return false;
}
}
i++;
}
}
My checkboxes are moving in a loop:
<input type="checkbox" name="chkID[]" id="chkID[]" value="<?=$rowSubjectsx['ID']?>">
Textboxes are also moving in a loop:
<input type="text" name="quantity[]" id="quan[]" size="3"/>
Please help............