![]() |
Two authboxes causing javascript error
OK, experimenting with two authentication boxes (authbox.tpl) on the page, but the strange thing is that when I click the "Logoff" text next to the "Go" button, it results in a javascript error "Object does not support this method". Alternatively, if I click the "Go" button it does actually logoff. This behaviour only happens when the two authboxes are present on the page.
I've seen this mentioned once before on the forum but no solution or reason as to why it happens. The button code on the authbox is (which I gather is default X-Cart): Code:
{if $js_enabled} and the button/logout_menu.tpl is: Code:
<FONT class="VertMenuItems">{$lng.lbl_logoff} </FONT><INPUT type="image" { include file="buttons/go_image_menu.tpl" }> Any ideas? Dan |
Worked it out. X-Cart/Javascript doesn't seem to like the two forms having the same name. I've made a second (copied) authbox.tpl and changed the "name" of the form from:
Code:
<FORM action="{$xcart_web_dir}/include/login.php" method="post" name="loginform"> to: Code:
<FORM action="{$xcart_web_dir}/include/login.php" method="post" name="loginform2"> then I updated the a href tag of the button to reference this form: I now have the original authbox.tpl on the side menu and the doctored authbox.tpl (authbox_mod.tpl) within the page. It now logs off regardless of what's pressed! Dan |
I'm getting errors on this topic... I created a "Your Account" page which can display the login so I end up with 2 login boxes (one on the menu left and the "account" page I created).
I'm clear about the first part of your mod but where do I modify the button hyperlink you reference in the last entry of your mod? My issue is login in only not logout. I only display one logout button on the side menu. Thanks |
Hi,
In my modified auhtbox (authbox_mod.tpl) I have: Code:
which is the button code. Dan |
so you are adding the above code or modifying the existing code? Here is my version as of right now.
Code:
{* $Id: authbox_mod.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} |
My opening form tag is:
Code:
<FORM action="{$xcart_web_dir}/include/login.php" method="post" name="loginform2"> and then the bottom of my file looks like: Code:
{if $user_subscription ne ""} so long as the button code I gave is within the form tags it should work, so you may want to try something like: Code:
{* $Id: authbox_mod.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} which is the code you gave me and my button code inserted......that might work :? Dan |
other than authbox_mod are there any other files which need modification?
Thanks for thi shelp it's been driving me insane! |
No, all I did was make a copy of the authbox and then adjust the opening form tag (to read loginform2) and the button code.
Dan |
All times are GMT -8. The time now is 04:33 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.