Results 1 to 3 of 3

Thread: No Spaces or Hypens

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    Hampton Beach
    Posts
    513

    No Spaces or Hypens

    I am doing some form validation and I want to call a fucntion from my input box that will prevent users from enetring in a space or a "-"...

    How can I prevent users from enetring in spaces or "-" into the text box

  2. #2
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390
    <input ............ onKeypress="if (event.keyCode = 45 || event.keyCode = 32)event.returnValue = false;">

  3. #3
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390
    oh yea if u were wondering
    45 is the ascii code for -
    and 32 for space

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