Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Hide timer functionality on login page



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
n2deep



Joined: 12 Mar 2008
Posts: 1

PostPosted: Wed Mar 12, 2008 10:11 pm    Post subject: Hide timer functionality on login page Reply with quote

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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap