Hello,
I am trying to create a dynamically generated form with checkboxes.
Here is a sample code :
while ($i<$ncomp) {
?>
<input type="checkbox" name="comp[<? echo"$i";?>]" value=<? echo"$val"; ?> onclick="chg(comp[<? echo"$i; ?>)">
<?
$i++
}
and the beginning of the code for the "chg" function :
function chg(component)
{
if (composant.checked==true) ...
I have a javascript error (variable comp not definde). What is the problem with this ?
In advance, yhank you for any help.
- erwan -