Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 4th, 2004, 04:08 AM
Authorized User
Join Date: Nov 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Split Data Please Help

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
Old December 4th, 2004, 04:26 AM
Friend of Wrox
Join Date: Oct 2004
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

Hii gmk51080
try to use split() method
like this
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 :)

Old December 6th, 2004, 04:08 AM
Authorized User
Join Date: Nov 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts

Thank you very much it worked successfulyy

Georges M. Kaddoum

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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.