Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 4th, 2004, 04:08 AM
Authorized User
 
Join Date: Nov 2004
Location: Jbeil, Mont Liban, Lebanon.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Split Data Please Help

Hi
I'm new in javascripts
i have to split data in a textbox this mean that in the test box the value is : 10:20 i want to get the "10" and store into a varialbe then to get the "20" and store it into a 2de varibale.


thank you

Georges M. Kaddoum
__________________
<GMK>
Reply With Quote
  #2 (permalink)  
Old December 4th, 2004, 04:26 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii gmk51080
try to use split() method
like this
urvalue=":10:20"
arr=urvalue.split(":")
arr.length will give you length 3,but the values are only two,so it's matter of choice either you can remove your first ":" ,then use split method or leave it remain and get the value
When i don't remove first ":" then
arr.length will give length 3
value_a=arr[1] // will give you "10"
value_b=arr[2] // will give you "20"
if You remove first ":" then then arr[0] and arr[1] will give you the required result.
Hope this will help you

Cheers :)

vinod
Reply With Quote
  #3 (permalink)  
Old December 6th, 2004, 04:08 AM
Authorized User
 
Join Date: Nov 2004
Location: Jbeil, Mont Liban, Lebanon.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much it worked successfulyy

Georges M. Kaddoum
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To Split or Not to Split darrenb Access 2 February 8th, 2008 12:28 PM
split() darkhalf Javascript 1 October 21st, 2005 11:34 AM
Split crmpicco VB How-To 6 May 17th, 2005 04:16 AM
split crmpicco Classic ASP Basics 2 February 14th, 2005 08:48 AM
Split Data into Multiple Tables jemacc SQL Server 2000 20 June 19th, 2004 03:40 PM



All times are GMT -4. The time now is 09:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.