Click to See Complete Forum and Search --> : I don't understand these javascript function calls


SeanPaul72
08-07-2003, 02:55 PM
here is a list of variables that the function uses to validate data.


NumCheck = "0123456789"
dblCheck = "0123456789."
StrCheck = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
SpaceCheck = " "
OtherCheck = "<,>.?/:;{[}[|\!@#$%^&*()_-+="

Then here is the function:

function dbCheck(Ctrl, strCheck)
{
newstr = "";
for (i=0; i<Ctrl.value.length; i++)
{
letter = Ctrl.value.charAt(i);
if(isValid(letter, strCheck))
{
newstr = newstr + letter
}
}
Ctrl.value = newstr
}


Then here is the call of the function:dbCheck(document.lion1003.L22, dblCheck + SpaceCheck + StrCheck);


Could someone explain the function to me. I'm not sure I understand it's necessity or its process.

Thanks.

Charles
08-07-2003, 03:08 PM
It looks to me like someone who doesn't know about Regular Expressions is tryig to validate some values. Ignore that stuff and read instead http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/regexp.html.