vForums Support > Programming & Coding :: Database of Codes/Hacks/Mods :: > Confirm Logout

Confirm Logout - Posted By Michael (wrighty) on 16th Mar 08 at 11:31am
This will create a 'confirm box' asking if you are sure you want to log out.


<script>
/*Confirm Logout
Coded By Wrighty
No Ripping, Reposting or Claiming*/

var _a = 'Are you sure you wish to logout?'

function _x(){
    if(confirm(_a)){
        location.href = '/action/logout'
    }
}
var _b = get('menu_buttons','id').getElementsByTagName('a')[get('menu_buttons','id').getElementsByTagName('a').length -1]
if(vf_username != 'guest'){
    _b.href = 'javascript:_x();';
}
</script>


Main Header

Re: Confirm Logout - Posted By Alex Bailey (system) on 18th Jul 08 at 9:30pm
not working for me :/

www.bailey.vforums.co.uk

Re: Confirm Logout - Posted By Marc (cr0w) on 19th Jul 08 at 9:41pm
Make sure this code is above the "Add Website Link To Menu" code. {Wink}

Re: Confirm Logout - Posted By Alex Bailey (system) on 20th Jul 08 at 2:22pm
ah thanks {Cheesy}

Re: Confirm Logout - Posted By Marc (cr0w) on 20th Jul 08 at 3:30pm
No worries; I first realized the error when the "Website" button asked me if I was sure I wanted to logout. {Tongue Out}

Re: Confirm Logout - Posted By ashkir (ashkir) on 28th Jul 08 at 11:08pm
Preview :] http://wimg.co.uk/OFQRys.gif

Tried in Safari, Opera, Internet Explorer and Firefox all have the same box and no special effects, so not uploading each screenshot. :].