Help - Search - Members - Calendar
Full Version: Change Login Text To Logout
MonsterSmallBusiness Forums > MonsterCommerce > How do I?
totlcomp
I remember seeing a post that detailed how to determine if a user was logged into the website, and if they were, change the text from Login to Logout.

I've search the forums relentlessly and can't find the post for the life of me and it's driving me nuts. Does anyone know how to do this?

Thanks!
andres.choi
QUOTE(totlcomp @ Jun 16 2008, 07:11 AM) *
I remember seeing a post that detailed how to determine if a user was logged into the website, and if they were, change the text from Login to Logout.

I've search the forums relentlessly and can't find the post for the life of me and it's driving me nuts. Does anyone know how to do this?

Thanks!


Hey Totalcomp! I hope you are doing fine... This is the one I have in my site... I hope it helps...

Let me know if you have any trouble with it and I'll try to help you out...


CODE
<span>
<div align="right">Welcome <%DRAWCUSTOMERWELCOME%> |
<a href="index.asp?PageAction=LOGIN">Login</a> |
<a href="index.asp?PageAction=MYACCOUNT">My Account</a></div>
</span>

CODE

<script type="text/javascript">
j=document.links;
for(i=0; i<j.length; i++)
{
if(j[i].href.match(/Login/i) && document.getElementById('CustomerName').title!='Guest')
{
j[i].href=j[i].href.replace(/LOGIN/i,'LOGOFF');
j[i].innerHTML=j[i].innerHTML.replace(/Login/i,'LOGOUT');
}
}
</script>


You can enter the script at the bottom of you page...

You need to have the <%DRAWCUSTOMERWELCOME%> in the page, and the Login as well for this to work

Good Luck!
totlcomp
Thank you so much!!!! That's the one I was looking for. I remember a code guru in the forums when I first started w/Monster and he posted a script that did this and couldn't find it for the life of me.

Thanks again thumbsup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.