4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: martrix on March 11, 2005, 11:34:44 PM

Title: [MOD] Autologin CheckBox state changing
Post by: martrix on March 11, 2005, 11:34:44 PM
Author of modification: V@no

Always when a checkbox appears on the internet I tend to click on the description text next to the checkbox... but it doesn't change the state of the CBox 

This tiny mod allows the user to change the „auto_login“-checkbox state by clicking the text next to it… and not only by clicking the "small" CheckBox itself.

open {your_template}/user_loginform.html

find:

Code: [Select]
<td><span class="smalltext">{lang_auto_login}</span></td>
change to:

Code: [Select]
<td><span class="smalltext" onClick="if(auto_login.checked) auto_login.checked=false; else auto_login.checked=true;" style="cursor:default;">{lang_auto_login}</span></td>
Title: Re: [MOD] Autologin CheckBox state changing
Post by: supastoked on July 01, 2005, 07:08:52 PM
Hey Guys,
Thanks for this - was just what i was looking for  :D  One thing i added though, was
Code: [Select]
style="cursor: pointer", just so users can see that they can click on the text.. Otherwise it is perfect!!!
Cheers
Chris
Title: Re: [MOD] Autologin CheckBox state changing
Post by: mawenzi on July 01, 2005, 07:39:50 PM
hi martrix,

also ... thanks for this nice tiny mod ...  :D
@supastoked ... correct : style="cursor: pointer" ...  :!:

mawenzi
Title: Re: [MOD] Autologin CheckBox state changing
Post by: BartAfterDark on November 26, 2005, 02:00:40 PM
it should be autologin instead of auto_login.
At least on my site
Title: Re: [MOD] Autologin CheckBox state changing
Post by: V@no on November 26, 2005, 05:52:25 PM
it should be autologin instead of auto_login.
At least on my site
Not in fresh 4images installation...
Title: Re: [MOD] Autologin CheckBox state changing
Post by: BartAfterDark on November 26, 2005, 06:41:50 PM
hmm... maybe it's the phpbb mod :)
You know if it could work under firefox?
Title: Re: [MOD] Autologin CheckBox state changing
Post by: Acidgod on November 26, 2005, 06:43:08 PM
with netscape there is no problem, so i think its works in Firefox too...
Title: Re: [MOD] Autologin CheckBox state changing
Post by: BartAfterDark on November 26, 2005, 06:54:51 PM
Not quete
take a look on Vano's homepage.
http://gallery.vano.org/en/13932

with netscape there is no problem, so i think its works in Firefox too...
Title: Re: [MOD] Autologin CheckBox state changing
Post by: Acidgod on November 26, 2005, 06:58:09 PM
and then?
Title: Re: [MOD] Autologin CheckBox state changing
Post by: BartAfterDark on November 26, 2005, 06:59:46 PM
Can you mark the remember by clicking the text with FF?
Title: Re: [MOD] Autologin CheckBox state changing
Post by: Acidgod on November 26, 2005, 07:16:28 PM
i have it also on my site and with Netscape it works...
Title: Re: [MOD] Autologin CheckBox state changing
Post by: V@no on November 26, 2005, 07:41:57 PM
You are right, this method doesnt work on FF...
The work around I found so far is add id="auto_login" into the checkbox
and then use "cross-browser ID read" script.
So, the final code is:
Code: [Select]
<script language="javascript">
function get_id(id)
{
  if (document.getElementById) return document.getElementById(id);
  if (document.all && !document.getElementById) return document.all[id];
  if (document.layers) return document.layers[id];
}
</script>
<input type="checkbox" name="auto_login" id="auto_login" value="1" checked/>&nbsp;<span class="smalltext" onClick="alcb=get_id('auto_login');if(alcb.checked) alcb.checked=false; else alcb.checked=true;" style="cursor:default;">{lang_auto_login}</span>
(if you already have get_id() JS function, then you should not use mine.)
Title: Re: [MOD] Autologin CheckBox state changing
Post by: BartAfterDark on November 26, 2005, 09:05:10 PM
Great V@no.

Bart sends v@no a big hug  :mrgreen: