Hi,
This should be an easy question for someone who understands Javascript. I have the following code:
<form name="form2">
<input type='checkbox' name='chk1' onclick="fct('1','Paul');">
<input type='text' name='Tech'">
</form>
<script>
function fct(cnt,user)
{
if (window.document.form2.chk+cnt+.checked==true)
{
document.form2.Tech.value=user;
}
}
</script>
I need to simply test whether the checkbox is checked. But there is a variable I pass in the onclick event, which passes the number of the checkbox. I can't figure out how to refer to this checkbox control. The above code will not work.
Thanks for any help,
Paul
This should be an easy question for someone who understands Javascript. I have the following code:
<form name="form2">
<input type='checkbox' name='chk1' onclick="fct('1','Paul');">
<input type='text' name='Tech'">
</form>
<script>
function fct(cnt,user)
{
if (window.document.form2.chk+cnt+.checked==true)
{
document.form2.Tech.value=user;
}
}
</script>
I need to simply test whether the checkbox is checked. But there is a variable I pass in the onclick event, which passes the number of the checkbox. I can't figure out how to refer to this checkbox control. The above code will not work.
Thanks for any help,
Paul