I have a function into which I am passing an int which represents the index of a series of controls called things like txtName1, chkBastard1, and so on, to which I want to do unspeakable things.
I want to get the value of chkBastard1 in my function. The following works if I pass it in as an object:
<input type='checkbox' onclick='javascript:DoStuff(this);'>
DoStuff(theCheckbox) {
alert(theCheckbox.checked);
}
But I want to be able to do this:
<input type='checkbox' onclick='javascript:DoStuff(1);'>
DoStuff(intIndex) {
alert(["chkBastard" + intIndex].checked);
}
Is it possible? It MUST be possible.
I will probably do my usual and find the solution 3 minutes from now on t'internet.
:bu:
|