Click here to Skip to main content
15,915,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using html and servlets i just want to add a logout link in my home page after successfully logged in
Posted

Hi, Create 2 DIVs, one for login(username, password, submit controls) & another one for logout(logout link).
Assume DIVLogin for Login & DIVLogout for Logout
using javascript, when user logged in then call the script
JavaScript
document.getElementById('DIVLogin').style.display = 'none';
document.getElementById('DIVLogout').style.display = 'block';

otherwise call this
JavaScript
document.getElementById('DIVLogin').style.display = 'block';
document.getElementById('DIVLogout').style.display = 'none';
 
Share this answer
 
Create your logout link, and show/hide it depending on whether the user is logged in or not.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900