Logout using overlay menu?

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
arkhays
 
 
Posts: 7
Joined: Thu Apr 09, 2020 4:15 am

Logout using overlay menu?

Post 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.
User avatar
Pablo
 
Posts: 21573
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Logout using overlay menu?

Post by Pablo »

I think you will have to use JavaScript for this (not tested):

Code: Select all

document.getElementById('logoutform').submit();
HGF
 
 
Posts: 62
Joined: Sat Jul 31, 2021 7:54 am
Location: Cologne, Germany

Re: Logout using overlay menu?

Post 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
User avatar
Pablo
 
Posts: 21573
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Logout using overlay menu?

Post by Pablo »

Does the page have a logout button?
HGF
 
 
Posts: 62
Joined: Sat Jul 31, 2021 7:54 am
Location: Cologne, Germany

Re: Logout using overlay menu?

Post 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
User avatar
Pablo
 
Posts: 21573
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Logout using overlay menu?

Post 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?
HGF
 
 
Posts: 62
Joined: Sat Jul 31, 2021 7:54 am
Location: Cologne, Germany

Re: Logout using overlay menu?

Post 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
User avatar
Pablo
 
Posts: 21573
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Logout using overlay menu?

Post 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...
HGF
 
 
Posts: 62
Joined: Sat Jul 31, 2021 7:54 am
Location: Cologne, Germany

Re: Logout using overlay menu?

Post by HGF »

Okay, thank you very much, Pablo
Post Reply