Gokooljapan
05-06-2008, 10:49 PM
Here is my script. It works on "usernames" with someone@someone.com, but does not work on someone.someone@someone.com. I know it is the period in between...right before @.
Please let me know how to fix. thanks!
<html>
<head>
<title>Login</title>
<script lang="javascript" src="REMOVED URL FOR SECURITY PURPOSES"></script>
<script lang="javascript">
function login()
{
var qdb = new QClient();
qdb.Authenticate(document.getElementById('qdbusername').value, document.getElementById('qdbpassword').value);
qdb.GetTicket();
if(qdb.displayErrorAlert("The username and/or password are not recognized. Please check your username and password and try again. "))
{
return(false);
}
var a = document.getElementById('qdbusername').value;
var temp = new Array();
temp = a.split('@');
temp = a.split('.');
switch(temp[1]){
case 'com':
var url = "URL 1"
break;
case 'net':
var url = "URL 2"
break;
case 'org':
var url = "URL 3"
break;
default : alert("Cannot find your username.");
}
/*window.location.href = "REMOVED URL";*/
if (url.length > 4) {
window.location.href = url;
}else{
alert ("The username or password you typed was incorrect.");
}
return(true);
}
</script>
<link href="gwc.com" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #000000;
font-weight: bold;
}
-->
</style>
</head>
Please let me know how to fix. thanks!
<html>
<head>
<title>Login</title>
<script lang="javascript" src="REMOVED URL FOR SECURITY PURPOSES"></script>
<script lang="javascript">
function login()
{
var qdb = new QClient();
qdb.Authenticate(document.getElementById('qdbusername').value, document.getElementById('qdbpassword').value);
qdb.GetTicket();
if(qdb.displayErrorAlert("The username and/or password are not recognized. Please check your username and password and try again. "))
{
return(false);
}
var a = document.getElementById('qdbusername').value;
var temp = new Array();
temp = a.split('@');
temp = a.split('.');
switch(temp[1]){
case 'com':
var url = "URL 1"
break;
case 'net':
var url = "URL 2"
break;
case 'org':
var url = "URL 3"
break;
default : alert("Cannot find your username.");
}
/*window.location.href = "REMOVED URL";*/
if (url.length > 4) {
window.location.href = url;
}else{
alert ("The username or password you typed was incorrect.");
}
return(true);
}
</script>
<link href="gwc.com" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #000000;
font-weight: bold;
}
-->
</style>
</head>