Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: strings as an object ??


Message #1 by =?iso-8859-1?q?mark=20van=20lieshout?= <mark_vl@y...> on Fri, 10 Aug 2001 15:25:25 +0100 (BST)
use eval(myString+".checked")

> Hi,
> 
> I need to be able to have a string value's contents
> e.g :
> 
> myString = "CheckBoxName.checked";
> 
> interpreted 'literally' ?? I'm not to sure now to put
> it but it should be clear with this code :
> 
> if (mystring == true)
> {
> 
> }
> 
> or mabey like this ;
> 
> myString = "CheckBoxName";
> if (mystring.checked == true)
> {
> 
> }
> 
> So when the interpreter comes to mystring it actually
> see's the checkbox name and therefore looks at the
> checkbox's checked property.
> 
> Any ideas on how I can achieve this ? I need to as
> it'll enable me to do something dynamically.
> 
> Thanks for any help,
> 
> Mark

  Return to Index