var Foo = ValidateForNumb ("111", 3, 5, "Warning goes here")
------------------------
function ValidateForNumb (strEntry, intMin, intMax, strWarning)
{
var blnOK = /^\d{intMin,intM ax}$/.test(strEntry) ;
if ((blnOK == false) && (strEntry.lengt h > 0))
{
alert(strWarnin g);
return false;
}
return strEntry;
}
------------------------
What's odd is that I when I use hard coded min and max, it comes back as
true . . .
------------------------
function ValidateForNumb (strEntry, intMin, intMax, strWarning)
{
var blnOK = /^\d{3,5}$/.test(strEntry) ;
if ((blnOK == false) && (strEntry.lengt h > 0))
{
alert(strWarnin g);
return false;
}
return strEntry;
}
------------------------
I can't imagine that javascript can't use the variable, am I doing something
wrong here? What am I missing?
Please contact me if you have any questions,
Patrick Gibbons
fnkleroi@hotmai l.com
------------------------
function ValidateForNumb (strEntry, intMin, intMax, strWarning)
{
var blnOK = /^\d{intMin,intM ax}$/.test(strEntry) ;
if ((blnOK == false) && (strEntry.lengt h > 0))
{
alert(strWarnin g);
return false;
}
return strEntry;
}
------------------------
What's odd is that I when I use hard coded min and max, it comes back as
true . . .
------------------------
function ValidateForNumb (strEntry, intMin, intMax, strWarning)
{
var blnOK = /^\d{3,5}$/.test(strEntry) ;
if ((blnOK == false) && (strEntry.lengt h > 0))
{
alert(strWarnin g);
return false;
}
return strEntry;
}
------------------------
I can't imagine that javascript can't use the variable, am I doing something
wrong here? What am I missing?
Please contact me if you have any questions,
Patrick Gibbons
fnkleroi@hotmai l.com
Comment