Xion
07-10-2003, 08:06 PM
I wrote a validation script that has to match certain characters in the username based on there email domain with our company.
var UN
UN = (document.forms["customers"].UserName.value)
var Srch
switch(document.forms["customers"].EmailDomain.value)
{
case "calif":
Srch = UN.match(".ca")
if (Srch == null) {
alert("You need to have username.ca in the Username Field");
return false;
}
break;
The problem is that its matching just "ca" and not ".ca". Anybody have any ideas on how to force it to match ".ca" ?
var UN
UN = (document.forms["customers"].UserName.value)
var Srch
switch(document.forms["customers"].EmailDomain.value)
{
case "calif":
Srch = UN.match(".ca")
if (Srch == null) {
alert("You need to have username.ca in the Username Field");
return false;
}
break;
The problem is that its matching just "ca" and not ".ca". Anybody have any ideas on how to force it to match ".ca" ?