restricting form field to numbers without separators XI
Technically, that still allows the user to enter the minus symbol and a period.
If you really want to only allow numbers you can use this code as the custom Keystroke script:
event.rc = /^\d*$/.test(event.change);
I found this really useful, thanks for the post.
I've tried to amend the reg exp to allow a '+' symbol, for a telephone number area code, and spaces but as yet no luck. Please can you point me in the right direciton.
Thanks in advance.
In that case I recommend using the Arbitrary Mask under Format - Special. You can specify this pattern like this (for example):
+99 999 9999
Letters only: event.rc = /^[a-z]*$/i.test(event.change);
Letters and digits only: event.rc = /^[a-z\d]*$/i.test(event.change);
Perfect! Thank You so much