Choose from our various pricing plans. There is a package for everyone!


Logout Confirmation

View previous topic View next topic Go down

Topic Solved Logout Confirmation

Post by DreaMaker on Thu Nov 01, 2012 11:16 am

Forum Versions: Invision, PunBB, PhpBB 2, PhpBB 3

Description: This tutorial will ask your user if there sure they want to logout.

Set up:
1. Go to Admin Panel -> Modules -> JavaScript Codes Management -> Make sure it's on -> Create new -> Title it "Logout" - > Select "In all pages" -> Paste in the box:

Code:
$(document).ready(function() {
var x = document.getElementById('logout');
$(x).click(function(cLogout) {
var y = confirm("Are you sure you want to logout?");
if (y == true) {
return true;
} else { cLogout.preventDefault(); }
});
});

2. Hit save and you're done.
avatar
DreaMaker
Member
Member

Age : 29
Posts : 11
Join date : 2012-10-20
Reputation : 1

View user profile

Back to top Go down

Topic Solved Re: Logout Confirmation

Post by mo'emn fox on Sat Mar 02, 2013 9:01 pm

Very Happy
avatar
mo'emn fox
Member
Member

Age : 24
Posts : 2
Join date : 2013-01-05
Reputation : 1

View user profile

Back to top Go down

Topic Solved Re: Logout Confirmation

Post by Irate on Wed May 01, 2013 10:19 am

How is cLogout.preventDefault() defined here?
avatar
Irate
Member
Member

Age : 21
Posts : 91
Join date : 2013-05-01
Forum Version : PhpBB2
Reputation : 2

View user profile http://duelacademy.net

Back to top Go down

Topic Solved Re: Logout Confirmation

Post by Kilhen on Thu May 02, 2013 10:19 am

Return element false; no redirect to link.
avatar
Kilhen
Member
Member

Age : 23
Posts : 9
Join date : 2012-05-21
Forum Version : PhpBB3
Reputation : 0

View user profile http://dworld.forumz.ro/

Back to top Go down

Topic Solved Re: Logout Confirmation

Post by Irate on Thu May 02, 2013 10:45 am

Right, I didn't see that he defined cLogout as local variable to jQuery(x).click(function())

Well done.
avatar
Irate
Member
Member

Age : 21
Posts : 91
Join date : 2013-05-01
Forum Version : PhpBB2
Reputation : 2

View user profile http://duelacademy.net

Back to top Go down

Topic Solved Re: Logout Confirmation

Post by Dusan on Wed May 15, 2013 1:26 pm

User inactive and seems not to need help. Closed.
avatar
Dusan
Member
Member

Age : 22
Posts : 711
Join date : 2012-06-08
Forum Version : PunBB
Reputation : 36

View user profile http://www.csshelp.net

Back to top Go down

Topic Solved Re: Logout Confirmation

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum