Hi I am new to Javascript. Is it possible to have a form field that can be submitted empty but when it is entered it must be a 6 digit number only.
I have experimented with onKeypress in the input field and it work great:
onKeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;"
I have found a few scripts that can make the length 6 digits long but won't let an empty field submit.
Any help here would be very much appreciated![]()


Reply With Quote
Bookmarks