loophole
03-25-2003, 06:36 AM
I am trying to put a variable insise form variable to loop through them. I could not get this to work.
Please anyone have any suggestions.
for (var count = 1; count < 6; count++)
{
if ( theForm.n_rms.value > count)
{
var xcnt = count++;
if (("theForm.rm_" + xcnt + "_occu.value" != "CHD") && ("theForm.rm_" + xcnt + "_adt.value" == "0"))
{
alert("Please state the no. of adults for room xcnt\n");
"theForm.rm_" + xcnt + "_adt.focus()";
return (false);
}
}
} // end of loop
I am simply trying to put variable xcnt into the form variable.
Thanks,
Hasan
:confused:
Please anyone have any suggestions.
for (var count = 1; count < 6; count++)
{
if ( theForm.n_rms.value > count)
{
var xcnt = count++;
if (("theForm.rm_" + xcnt + "_occu.value" != "CHD") && ("theForm.rm_" + xcnt + "_adt.value" == "0"))
{
alert("Please state the no. of adults for room xcnt\n");
"theForm.rm_" + xcnt + "_adt.focus()";
return (false);
}
}
} // end of loop
I am simply trying to put variable xcnt into the form variable.
Thanks,
Hasan
:confused: