1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to default "checked" stay loggedin?

Discussion in 'XenForo Questions and Support' started by swatme, Aug 12, 2011.

  1. swatme

    swatme Well-Known Member

    hi guys

    i want the stay logged in checkbox to be checked as default.

    how ?

    thanks
     
    Digital Doctor likes this.
  2. James

    James Well-Known Member

    add checked="checked" to the input in the template.
     
    swatme likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here are detailed instructions:

    Admin CP -> Appearance -> Templates -> login_bar_form

    Add the red code (scroll right):

    Code:
    		<dl class="ctrlUnit submitUnit">
    			<dt></dt>
    			<dd>
    				<input type="submit" class="button primary" value="{xen:phrase log_in}" tabindex="105" data-loginPhrase="{xen:phrase log_in}" data-signupPhrase="{xen:phrase sign_up}" />
    				<label for="ctrl_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_remember" tabindex="104" checked="checked" /> {xen:phrase stay_logged_in}</label>
    			</dd>
    		</dl>
    
    There are two similar edits in this template:

    Admin CP -> Appearance -> Templates -> helper_login_form

    Add the red code (scroll right):

    Code:
    <xen:if is="{$xenOptions.registrationSetup.enabled}">
    	<dl class="ctrlUnit">
    		<dt><label for="ctrl_pageLogin_password">{xen:phrase do_you_already_have_account}</label></dt>
    		<dd>
    			<ul>
    				<li><label for="ctrl_pageLogin_not_registered"><input type="radio" name="register" value="1" id="ctrl_pageLogin_not_registered" />
    					{xen:phrase no_create_account_now}</label></li>
    				<li><label for="ctrl_pageLogin_registered"><input type="radio" name="register" value="0" id="ctrl_pageLogin_registered" checked="checked" class="Disabler" />
    					{xen:phrase yes_my_password_is}:</label></li>
    				<li id="ctrl_pageLogin_registered_Disabler">
    					<input type="password" name="password" class="textCtrl" id="ctrl_pageLogin_password" />					
    					<div><label for="ctrl_pageLogin_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_pageLogin_remember" checked="checked" /> {xen:phrase stay_logged_in}</label></div>
    				</li>
    			</ul>
    		</dd>
    	</dl>
    <xen:else />
    	<dl class="ctrlUnit">
    		<dt><label for="ctrl_pageLogin_password">{xen:phrase password}:</label></dt>
    		<dd>
    			<input type="password" name="password" class="textCtrl" id="ctrl_pageLogin_password" />					
    			<div><label for="ctrl_pageLogin_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_pageLogin_remember" checked="checked" /> {xen:phrase stay_logged_in}</label></div>
    		</dd>
    	</dl>
    </xen:if>
    
     
    MMAcomm, NSL, Veer and 4 others like this.
  4. swatme

    swatme Well-Known Member

    nice! thanks :)
     
  5. RoldanLT

    RoldanLT Well-Known Member

    Xf 1.1.3 code is different.
     
  6. Morgain

    Morgain Well-Known Member

    I'm pretty sure there's something in Resources for this because I asked for it ages ago
     
  7. RoldanLT

    RoldanLT Well-Known Member

    I sorted it already.
    I only add this: checked="checked" :)
     
  8. JamesBrown

    JamesBrown Well-Known Member


    can't find this code in 1.3
     
  9. RoldanLT

    RoldanLT Well-Known Member

    Jake says
    Not find ;)
     
  10. AndyB

    AndyB Well-Known Member

Share This Page