HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

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 ASP Free Forums Sponsor:
  #1  
Old August 6th, 2004, 10:13 PM
mspaul mspaul is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 23 mspaul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 20 sec
Reputation Power: 0
Block all Uppercase letters... Help!

Hi Guys,

I'm launching my web site tomorrow and i just found out that when a member signs up.. and if he enters "TESTtest" as his username and "TESTtest" as his password....

He can access him membership even if he enters "testtest".... How can I use JavaScript to Block a user from entering UppErcase Letters completely...

So if they should enter a uppercase letter via "capslock" or by pressing shift.. It displays a error and does not proceed unless all letters are lowercase..

Please help guys....

Cheers and regards..

Reply With Quote
  #2  
Old August 7th, 2004, 03:03 AM
coinhunter's Avatar
coinhunter coinhunter is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Battle Creek, Michigan
Posts: 352 coinhunter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 sec
Reputation Power: 5
Send a message via Yahoo to coinhunter
Here is a solution for you that I came up with. It involves using regular expressions with javascript. Place the code inside the HEAD tags. Here is the code:
Quote:
<script language="JavaScript">
function validate()
{
// Regular Expression coded by: coinhunter of ASP Free Forums
var objRegExp = new RegExp("([A-Z]+)");
if (document.login.username.value.match(objRegExp))
{
alert("No Capital Letters Allowed!");
document.login.username.focus();
return (false);
}
return true;
}
</script>

Notes:
  1. Change the alert message to whatever you want to say.
  2. Inside the code replace "login" with the name of your form.
  3. Replace "username" with the name of your username field.
  4. Just Duplicate it to check the password field as well.
  5. Important: Will not work if users have Javascript turned OFF.
If you have questions or problems don't hesitate to ask. Good Luck!

Reply With Quote
  #3  
Old August 7th, 2004, 08:00 PM
mspaul mspaul is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 23 mspaul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 20 sec
Reputation Power: 0
It worked

coinhunter..
I salute you.. thanks mate that worked great..

Reply With Quote
  #4  
Old August 7th, 2004, 09:48 PM
coinhunter's Avatar
coinhunter coinhunter is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Battle Creek, Michigan
Posts: 352 coinhunter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 sec
Reputation Power: 5
Send a message via Yahoo to coinhunter
Glad to hear.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Block all Uppercase letters... Help!


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 5 hosted by Hostway
Stay green...Green IT