I would use the function called split() which makes an array based on a
delimiter passed in (in your case the comma). Then you can loop over the
array or access the elements as you need:
var x = 'test1,test2,test3,test4';
arElements = x.split(',');
would result in...
arElements[0] = 'test1'
arElements[1] = 'test2'
arElements[2] = 'test3'
arElements[3] = 'test4'
HTH,
Mike
_____
From: Andrew Scott [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 10:03 PM
To: CF-Talk
Subject: _javascript_ Help
Looking for any help in being able to do the following.
I am looking at a string "test,test1,test2,test3", and what I would like to
do is get the value of these from the form variable sounds simple enough.
But how to I get the item out of the string using _javascript_. In coldfusion
I would used ListGetAt, but I can't seem to find anything in JS to do this.
Regards
Andrew Scott
Technical Consultant
NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205
Phone: 03 9686 0485 - Fax: 03 9699 7976
_____
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- JSP and Cold Fusion. Ian Skinner
- Re: JSP and Cold Fusion. Pete Freitag
- Re: JSP and Cold Fusion. Rick Root
- Javascript Help Andrew Scott
- RE: Javascript Help Michael T. Tangorre
- RE: Javascript Help Andrew Scott
- Re: JSP and Cold Fusion. Calvin Ward
- Re: JSP and Cold Fusion. Pete Freitag
- Re: JSP and Cold Fusion. Michael Dinowitz
- Re: JSP and Cold Fusion. Paul Hastings