
August 7th, 2004, 03:03 AM
|
 |
Contributing User
|
|
Join Date: May 2004
Location: Battle Creek, Michigan
Posts: 352
Time spent in forums: 30 sec
Reputation Power: 5
|
|
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:- Change the alert message to whatever you want to say.
- Inside the code replace "login" with the name of your form.
- Replace "username" with the name of your username field.
- Just Duplicate it to check the password field as well.
- Important: Will not work if users have Javascript turned OFF.
If you have questions or problems don't hesitate to ask. Good Luck! 
|