[Javascript] variable problem

rastlore at yahoo.ca rastlore at yahoo.ca
Thu Jun 7 08:56:38 CDT 2001


Hello,  I am having a problem, I am a newbie at this javascript stuff 
by the way.  I was wondering why the below works (more specifically I 
am asking about the variables "i" and "j" why it works in the eval 
and not in the other statement is my question) :

if (eval("document.game_assesment.row"+ i +"_"+ j +".checked") == 
true)

but this give me an error :
document.game_assesment.row"+ i +"_"+ j +".checked = true;

I have also tried this, but it gives and error as well :
document.game_assesment.row'+ i +'_'+ j +'.checked = true;

The button's I am tried to access is :

<FORM NAME="game_assesment">
<INPUT type="radio" NAME="row0_0" VALUE="0">
<INPUT type="radio" NAME="row0_1" VALUE="0">
<INPUT type="radio" NAME="row0_2" VALUE="0">
</FORM>

Thanks for any help you could offer.





More information about the Javascript mailing list