Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 11-30-2008, 05:04 PM   #1
Fully Optimized
 
vampist's Avatar
 
Join Date: Oct 2008
Location: USA
Posts: 2,404
Default Split Splits?

Alright what I am trying to do is spit a string.

original string is: 1-F-2-F-3-F-4
How many a user specifies so say they want two.
Splits to: 1,2

or say they want 3

How many a user specifies so say they want three.
Splits to: 1,2,3

Here is the tricky part.

I would like to send back a
Code:
document.getElementById(id).style.color="#FFF";
line.

See the var id would be the split string numbers.
How can I do this?

I know you can do this in PHP easy, but I have to have this part client side.
Aka handy dandy JavaScript.
For any help I get here is a thank you in advance. Thank you!
__________________

vampist is offline   Reply With Quote
Old 12-01-2008, 11:43 PM   #2
Fully Optimized
 
vampist's Avatar
 
Join Date: Oct 2008
Location: USA
Posts: 2,404
Default Re: Split Splits?

Alright so I changed the join character I used to " ". So now it strings off as 1 2 3 4.. etc.


So what I need to know is there a way I can tell JavaScript to take individual numbers one at a time in say a while or for statement?

Such as the strtok() from php.
vampist is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 04:43 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0