Use the eval function.

eval("document.Slider" + i + ".GetValue()");

Roughly.

Jay

At 05:48 PM 12/13/2000 +0000, you wrote:
>OK guys and girls...slightly ot question but it's bugging me!  In part of a
>Javasript function I am trying to loop through a collection of controls and
>adding their value to a list which is then the value of a text box.  Here is
>the code:
>
>var i = 1;
>   while(i <= document.skills.slidercount.value)
>    {
>            document.skills.slidervalues.value =
>document.skills.slidervalues.value + "," + document.{"Slider" + value of
>i}.GetValue();
>            i = i + 1;
>    }
>
>'Skills' is a form.
>Slidercount.value = 34.
>Slidervalues is a textbox
>
>What I need to do is replace .{"Slider" + value of i} with Slider1, Slider2,
>Slider3, etc..... until Slider.34.  Is there a way to dynamically create
>this variable name?
>------------------------------------------------------------------
>Andrew Ewings
>Project Manager
>Thoughtbubble Ltd
>http://www.thoughtbubble.net
>------------------------------------------------------------------
>United Kingdom
>http://www.thoughtbubble.co.uk/
>Tel: +44 (0) 20 7387 8890
>------------------------------------------------------------------
>New Zealand
>http://www.thoughtbubble.co.nz/
>Tel: +64 (0) 9 419 4235
>------------------------------------------------------------------
>The information in this email and in any attachments is confidential and
>intended solely for the attention and use of the named addressee(s). Any
>views or opinions presented are solely those of the author and do not
>necessarily represent those of Thoughtbubble. This information may be
>subject to legal, professional or other privilege and further distribution
>of it is strictly prohibited without our authority. If you are not the
>intended recipient, you are not authorised to disclose, copy, distribute, or
>retain this message. Please notify us on +44 (0)207 387 8890.
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to