Results 1 to 4 of 4

Thread: Parsing a text field with JavaScript

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Philadelphia
    Posts
    123

    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)

  2. #2
    Lively Member Base's Avatar
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    65
    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
    Ok

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Philadelphia
    Posts
    123
    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)

  4. #4
    Lively Member Base's Avatar
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    65
    Nevermind. Why invent something twice right!
    Ok

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width