|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Checking if the field contains letters
Hi all!
A field in the form must have a numbers only input. How can i write JS script to display an alert when one or all characters in the field is letter(s) instead of numbers? Thanks |
|
#2
|
|||
|
|||
|
RE: Checking if the field contains letters
check out this link:
http://developer.irt.org/script/354.htm |
|
#3
|
|||
|
|||
|
RE: Checking if the field contains letters
Thanks for the link.
Also, another field can only have lower and/or upper case letters. below is condition but it doesn't work: /^[a-z][A-Z]$/i |
|
#4
|
|||
|
|||
|
RE: Checking if the field contains letters
[a-z]/[A-Z] only:<br>
<input type=text onKeypress="if(event.keyCode > 48 && event.keyCode < 57) return false;"> <p> [0-9] only:<br> <input type=text onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"> |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Checking if the field contains letters |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|