D
DougJrs
Good Morning,
I am trying to write a simple function that would grab the "errorId"
parameter and then display a message when the page loads. I basically
have a login page (login.asp) that if the login fails the user is
directed page to the login page with an errorId parameter (login.asp?
errorId=1).
I wrote the javascript below to grab the paramater and then retuen a
message (I borrowed the gup function from an example, and wrote the
getMessage)
Now, my problem is that I am not sure how to get the message returned
by getMessage displayed on the screen. I think that adding the
function to window.onload would call it when the page loads, but I
don't know how to get the text written out to the browser window.
Thanks in advance for any help!
Doug
function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];
}
function getMessage( )
{
var error = gup("errorId");
if (error == "") return "";
else return "Email address and password combination not found.";
}
I am trying to write a simple function that would grab the "errorId"
parameter and then display a message when the page loads. I basically
have a login page (login.asp) that if the login fails the user is
directed page to the login page with an errorId parameter (login.asp?
errorId=1).
I wrote the javascript below to grab the paramater and then retuen a
message (I borrowed the gup function from an example, and wrote the
getMessage)
Now, my problem is that I am not sure how to get the message returned
by getMessage displayed on the screen. I think that adding the
function to window.onload would call it when the page loads, but I
don't know how to get the text written out to the browser window.
Thanks in advance for any help!
Doug
function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];
}
function getMessage( )
{
var error = gup("errorId");
if (error == "") return "";
else return "Email address and password combination not found.";
}