Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 4th, 2004, 05:45 PM
shnackattack shnackattack is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 60 shnackattack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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

Reply With Quote
  #2  
Old January 4th, 2004, 09:46 PM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
RE: Checking if the field contains letters

check out this link:
http://developer.irt.org/script/354.htm

Reply With Quote
  #3  
Old January 4th, 2004, 11:05 PM
shnackattack shnackattack is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 60 shnackattack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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


Reply With Quote
  #4  
Old January 5th, 2004, 12:39 AM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
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;">


Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Checking if the field contains letters


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT