Title: [OT] JavaScript Help

The easiest way would to just add them to the line

var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\-\=\|abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/;

 

 

 

 

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Dan Stein
Sent: Monday, July 08, 2002 9:30 AM
To: Multiple recipients of list witango-talk
Subject: Witango-Talk: [OT] JavaScript Help

 

I need to know how to make the forbidden characters include A-Z this is pretty cool. It just deletes the bad characters when they type them in.
Full script is attached

<SCRIPT LANGUAGE="JavaScript">

<!-- Original:  Mikhail Esteves ([EMAIL PROTECTED]) -->

<!-- Web Site:  http://www.freebox.com/jackol -->

 

<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->

 

<!-- Begin

var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\-\=\|]/; <!-- This is where I need to add A-Z if I can -->

function dodacheck(val) {

var strPass = val.value;

var strLength = strPass.length;

var lchar = val.value.charAt((strLength) - 1);

if(lchar.search(mikExp) != -1) {

var tst = val.value.substring(0, (strLength) - 1);

val.value = tst;

   }

}

function doanothercheck(form) {

if(form.value.length < 1) {

alert("Please enter something.");

return false;

}

if(form.value.search(mikExp) == -1) {

alert("Correct Input");

return false;

}

else {

alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ - { + } `  = | \n\r\n\rare not allowed!\n");

form.select();

form.focus();

return false;

}

alert("Correct Input");

return false;

}

//  End -->

</script>

 

</HEAD>


--
Dan Stein
Digital Software Solutions
799 Evergreen Circle
Telford PA 18969
Land: 215-799-0192
Mobile: 610-256-2843
Fax 413-410-9682
FMP, WiTango, EDI,SQL 2000
[EMAIL PROTECTED]
www.dss-db.com

Reply via email to