Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 18th, 2024, 1:24 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: CSV question
PostPosted: May 5th, 2016, 6:15 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Hi,
I am working on a small HTML5 solution for a site i am working on.
What i need is in my eyes not complex but i can't find the right answer.

I have 2 names, separated by a comma
I need to paste that line with 2 names in an input box and the when i pus a button
the line have to brake in 2 so the first part of the line goes to a new variable called TXT1, and the other part of the text
has to go to a variable called TXT2.

I can't figure out how to get rid of the comma and how to get the text behind the comma in the second variable.
Like to hear from one of you.

Ad

This is the page i am working on: www.csnmedia.nl/txt

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: CSV question
PostPosted: May 5th, 2016, 8:07 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Use split.

Code:
myArray = myInputbox.split(",");
myPartA =  myArray[0];
myPartB = myArray[1];

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: CSV question
PostPosted: May 5th, 2016, 7:43 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thanks Mac,
Works great. Take a look at it on www.csnmedia.nl/txt


Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group