|
-
Jan 24th, 2002, 02:49 PM
#1
Thread Starter
Lively Member
Parsing a text field with JavaScript
I have an HTML form with a textbox in it that allows the users to enter either a single number, multiple numbers separated by commas, or a range of numbers, separated by a hyphen. For example.
15
23,44,55
11-29
Does anyone have a block of code that already does this or can point me to one?
Thank you.
VB6 & VC++6 Pro (SP4), Java (Sun JDK)
-
Jan 25th, 2002, 02:14 AM
#2
Lively Member
Hey,
Isn't that rather simple you just request te value and then try to slice it? First slice at "-" then check the first number and the second then slice at ",". May be an half an hour work, but you can do it!
Good luck
-
Jan 25th, 2002, 08:56 AM
#3
Thread Starter
Lively Member
Yeah, i know. I ended up doing it in about 10 minutes. I'm just lazy. Thanks!
VB6 & VC++6 Pro (SP4), Java (Sun JDK)
-
Jan 25th, 2002, 09:29 AM
#4
Lively Member
Nevermind. Why invent something twice right!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|