Page 1 of 1
Logout using overlay menu?
Posted: Thu Apr 09, 2020 4:25 am
by arkhays
I tried to integrate the overlay menu with logout by using events. On the Overlay Menu > Menu items > Sample Link > Events. I tried this settings,
Event: onclick
Action: Form Submit
Target: logout1
Tried this one also.
Event: onclick
Action: Form Submit
Target: loginform
it seems both not working, am i doing something wrong? or is this possible? by the way,
Already uploaded in the server, and all other login tools are working.
Any response is appreciated.
Re: Logout using overlay menu?
Posted: Thu Apr 09, 2020 6:25 am
by Pablo
I think you will have to use JavaScript for this (not tested):
Code: Select all
document.getElementById('logoutform').submit();
Re: Logout using overlay menu?
Posted: Mon Sep 06, 2021 3:11 pm
by HGF
Hello,
I'm searching for the same in responsive menu:
Event: onclick
Action: run javascript
Target: document.getElementById('logoutform').submit();
Unfortunately, this is not working.
Any idea?
Thanks in advance, HGF
Re: Logout using overlay menu?
Posted: Mon Sep 06, 2021 5:01 pm
by Pablo
Does the page have a logout button?
Re: Logout using overlay menu?
Posted: Wed Sep 08, 2021 5:22 am
by HGF
Pablo
If I add the logout extension to the page, the logout works when clicking the menu item. In order I hided the logout extension on the page this works okay as a workaround.
When removing the logout extension it does not work.
The html code of the logout extension is:
<form name="logoutform" method="post" action="<?php echo basename(__FILE__); ?>" id="logoutform" style="display:inline">
<input type="hidden" name="form_name" value="logoutform">
<button type="submit" name="logout" value="Logout" id="Logout1">Logout</button>
</form>
For a clear solution, I would like to have a logout menu item in the responsive menu what is logging the user out, without having the logout extension on the page.
My question is:
Is it possible to copy this code (and make it working) to the menu item of the responsive menu?
Possibly not, because the menu item is expecting a java script and not html.
Do you have a script accordingly to the html code?
Many thanks in advance
HGF
Re: Logout using overlay menu?
Posted: Wed Sep 08, 2021 6:04 am
by Pablo
When removing the logout extension it does not work.
Correct! Because without the logout button, the logout form does not exist on the form.
The suggested solution will not work without a logout out form on the page.
The code cannot be copied to the menu item of the responsive menu.
But why do you want to use custom code if all you will need to do if add a (hidden) logout button?
Re: Logout using overlay menu?
Posted: Wed Sep 08, 2021 9:40 am
by HGF
Hi Pablo,
thank you very much for your fast response.
In general I don't like hidden thinks.
But, if this is the only way to achieve this, I'm okay with it.
Thanks and Regards
HGF
Re: Logout using overlay menu?
Posted: Wed Sep 08, 2021 9:52 am
by Pablo
There is no difference between adding the code manaully to the page or adding a hidden button.
In both cases, you will need the code in order to be able to logout...
Re: Logout using overlay menu?
Posted: Thu Sep 09, 2021 5:26 pm
by HGF
Okay, thank you very much, Pablo