It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Hide timer functionality on login page

Hide timer functionality on login page

Postby n2deep on Wed Mar 12, 2008 9:11 pm

Hi,
I want to be able to hide the following timer on the log-in page but have it display on all subsequent pages upon successful login. ALL pages are created from a Master page which makes what I want to accomplish somewhat difficult for me but I believe it can be done.
===============================
<script type="text/javascript" language="javascript">
var seconds=0
var minutes = 45
try{document.getElementById("timer").innerHTML='45'}catch(err) {}

function display(){ //display time (minutes/seconds) before session timeout occurs
if (seconds<=0){ //if seconds reaches 0, a minute has passed so deduct a minute from the minute column
seconds=60
minutes-=1
}

if (minutes<=-1){ //stop the system at 0.0
seconds=0
minutes+=1
}
else //subtract a second as long as the above conditions aren't met
seconds-=1
try{document.getElementById("timer").innerHTML=minutes + " minutes " + seconds + " seconds"}catch(err) {}
setTimeout("display()",1000)
}
</script>
===============================
The code works fine. Once again, the code resides on a Master page that is accessed by all pages (including the log-in page). Is there a way i can call the code only when the user has successfully logged in?

I am attempting to use this on a .Net website and Javascript is not my strength. Any/all help is greatly appreciated!
n2deep
 
Posts: 0
Joined: Wed Mar 12, 2008 8:56 pm

Who is online

Users browsing this forum: No registered users and 2 guests