[Javascript] variable problem

Andrew Dunn adunn at mail.interworx.com.au
Thu Jun 7 09:18:18 CDT 2001


Hi,
   The eval() function evaluatates the arguement as an expression. It will
replace variable names with their values.

-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of rastlore at yahoo.ca
Sent: Thursday, 7 June 2001 11:57 PM
To: Javascript at LaTech.edu
Subject: [Javascript] variable problem


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.


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list