SimonMarkDawson
Programmer
Hello
Hopefully a simple one for you experts!
I want to use the 'onclick' event of one object to pass a different object (A 'hidden' variable in this case) to a javascript function. I then want the javascript function to change the value property of the hidden variable.
I obviously can't use 'this' in the onclick event so presume it's something to do with [] brackets. So far I've tried permutations along the lines of:
function hdnch(a){
document.form1[a].value='1';
}
called within form1 by
$temp='A'
<input type='hidden' name=$temp value='0'>
<table ... ><tr>
<td onclick=hdnch($temp)... etc>
but to no avail. Could the problem be in my attempt to use the $temp variable as an object handle? Unfortunately this is necessary as I can't assign names to all the hidden fields (within a loop) directly because of the complexity of the (LONG) form.
Am I a hopeless case and should I take up gardening instead?! Please help!
Many Thanks,
- Simon
Hopefully a simple one for you experts!
I want to use the 'onclick' event of one object to pass a different object (A 'hidden' variable in this case) to a javascript function. I then want the javascript function to change the value property of the hidden variable.
I obviously can't use 'this' in the onclick event so presume it's something to do with [] brackets. So far I've tried permutations along the lines of:
function hdnch(a){
document.form1[a].value='1';
}
called within form1 by
$temp='A'
<input type='hidden' name=$temp value='0'>
<table ... ><tr>
<td onclick=hdnch($temp)... etc>
but to no avail. Could the problem be in my attempt to use the $temp variable as an object handle? Unfortunately this is necessary as I can't assign names to all the hidden fields (within a loop) directly because of the complexity of the (LONG) form.
Am I a hopeless case and should I take up gardening instead?! Please help!
Many Thanks,
- Simon