Barkley564
Technical User
I've inherited some code that doesn't work properly. There are two functions involved in the problem. The first one calls the second one with this code:
The next function is:
It works great if the user has all 20 behavioral id's, but some don't, and it will fail on the first one they don't have. I get the is null or not an object error, and any buttons after the place it fails do not reset.
I do have a field that tells me whether a value is used for the person being queried, but I'm not sure how to make that happen. Can you use an if statement in a function? If so, how?
I'm a novice with java so I apologize if I didn't explain this properly.
Any suggestion is appreciated!
Code:
for (var x = 1; x <= document.all.maxBehavioralID.value; x++)
ResetRadioSelection(x);
Code:
function ResetRadioSelection(IndexID)
{
switch(IndexID)
{
case 1:
document.all.radio1[0].disabled=false;
document.all.radio1[0].checked=false;
document.all.radio1[1].disabled=false;
document.all.radio1[1].checked=false;
break;
case 2:
document.all.radio2[0].disabled=false;
document.all.radio2[0].checked=false;
document.all.radio2[1].disabled=false;
document.all.radio2[1].checked=false;
break;
<snip> repeated to case 20
I do have a field that tells me whether a value is used for the person being queried, but I'm not sure how to make that happen. Can you use an if statement in a function? If so, how?
I'm a novice with java so I apologize if I didn't explain this properly.
Any suggestion is appreciated!