Results 1 to 3 of 3

Thread: Numeric

  1. #1
    Join Date
    Dec 1969

    Default Numeric

    I should need a litle script that makes it impossible to write letters in a form i only want to make it possible to write Numbers.<BR>Is this hard to make?<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default Nope, and frankly, it's probably..

    .. already been done.<BR><BR>Try and

  3. #3
    Join Date
    Dec 1969

    Default Actually, it's not easy, at all...

    It&#039;s easy to intercept the keyboard and "approve" only numeric characters.<BR><BR>But then what about editing characters? Move cursor left? Backspace? Delete?<BR><BR>Okay, you can even handle them reasonably well.<BR><BR>But then what about the person who uses copy/paste via the mouse to put stuff into a form field? No keyboard was used so how do you detect *that*???<BR><BR>SO....<BR><BR>My solution has always been to run a "checkFields" function off of a timer. Every quarter of a second or so, each field of interest is checked to see if it contains digits only. If any non digits, you could either put a nasty message up on the screen telling the person he/she is a dork or just zap the offending characters (or both, your choice).<BR><BR><BR>

Posting Permissions

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