Disabling the space bar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to prevent users from entering a space in a form field. On a
form is a field for the phone number, it is formatted as a phone number. When
properly entered a - is automatically entered into the number. I have the
field size set to 8 in order to allow for the numbers and dash. Unfortunately
when users enter in a number, some ant to add a dash, thereby preventing the
addition of the last number and messing up my database with iunvalid phone
numbers.

I just want to remind them when they press the space bar or "-" to just
enter the numbers. I am sure there is code which will do this through the
keypress, keydown, or before update events.

thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top