Forums

This topic is locked

Login Page MM_UserAuthorization

Posted 22 Aug 2001 16:55:59
1
has voted
22 Aug 2001 16:55:59 ike austin posted:
Login Page

JAVASCRIPT

I created this function ( AccessLevel() ) that is called on a onLoad (When page loads) Event.
After login,, the page is returned to itself along with the MM_Username and MM_UserAuthorizatio values.
(The values do in fact appear on the page where I display them.)

The function should after reading the MM_UserAuthorization value, give an alert message (This is for temp testing only),
In final production it should redirect to new page based on the MM_UserAuthoriazation value recieved.

Each time I run the code nothing happens, no alert message and no page rediretion, however, both MM_UserAuthorization and MM_Username appear as they should.

Are all my coding elements onLoad, functions, etc in the right places?
should the javascript code be somewhere else?
------See code below------

<html>
<head>
<title>AdminLogin</title>

<SCRIPT LANGUAGE ="JAVASCRIPT">
function AccessLevel(){
if("<%=Session("MM_UserAuthorization"%>=="2"{
alert("Admin Level"; file://test line only --to be removed
document.location = "adminpage1.asp";
//Response.Redirect(testpage1.asp)
}
}

function AccessLevel(){
if("<%=Session("MM_UserAuthorization"%>=="1"{
alert("Entry Level"; file://test line only --to be removed
document.location = "entrylevel_page1.asp";
//file://Response.Redirect(testpage1.asp)
}
}

</script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onLoad="AccessLevel()" bgcolor="#FFFFFF" text="#000000">

Need Help

iaustin


Replies

Replied 23 Aug 2001 23:19:34
23 Aug 2001 23:19:34 B. B. replied:
Hey! Looks like you have the function defined two times. You need to remove the second function statement and put the two blocks of code in one function. Nothing happens now because the function is defined twice and cannot be resolved at load time. Hope this helps. Thanks!



Reply to this topic