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
Printable View
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
<input ............ onKeypress="if (event.keyCode = 45 || event.keyCode = 32)event.returnValue = false;">
oh yea if u were wondering
45 is the ascii code for -
and 32 for space