ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

[SOLVED] Comment form: "remember me" not working...

September 09, 2011 9:30pm

Subscribe [5]
  • #1 / Sep 09, 2011 9:30pm

    mhulse

    329 posts

    ExpressionEngine 1.7.1
    Build: 20110520

    First, my code:

    {exp:comment:form dynamic="off" cache="yes" refresh="999"}
        
        <div><input type="hidden" name="posted" value="1"></div>
        
        {if logged_out}
            
            <div class="fm">
                <label for="fm_comment_name">Name</label>
                <input type="text" id="fm_comment_name" name="name" maxlength="50" value="{name}">
            </div>
            
            <div class="fm">
                <label for="fm_comment_email">Email</label>
                <input class="email" type="email" id="fm_comment_email" name="email" maxlength="50" value="{email}">
            </div>
            
            <div class="fm">
                <label for="fm_comment_location">Location</label>
                <input type="text" id="fm_comment_location" name="location" maxlength="50" value="{location}">
            </div>
            
        {/if}
        
        <div class="fm ta">
            <label for="fm_comment_comment">Comment</label>
            <textarea id="fm_comment_comment" name="comment" cols="30" rows="15">{comment}</textarea>
        </div>
        
        <ul class="form_opts">
            {if logged_out}
                <li><input type="checkbox" id="fm_comment_notify_me" name="notify_me" value="yes" {save_info}> <span>Remember my personal information?</span></li>
            {/if}
            <li><input type="checkbox" id="fm_comment_save_info" name="save_info" value="yes" {notify_me}> <span>Notify me of follow-up comments?</span></li>
        </ul>
        
        {if captcha}
            
            <div class="captcha">{captcha}</div>
            <div class="fm">
                <label for="fm_comment_captcha">Captcha</label>
                <input type="text" id="fm_comment_captcha" name="captcha" value="" maxlength="20">
            </div>
            
        {/if}
        
        <input class="submit" type="submit" name="submit" value="Submit">
        
    {/exp:comment:form}

    Just wondering what could stop the “Remember my personal information?” from working?

    When we submit comments, logged out of the admin, the name/email field’s values are not pre-populated with that users name and email.

    Any tips on how to fix this?

    I could swear this worked at one point… It’s just been a while since I last paid attention to the option (us developers don’t make many comments to our blogger’s blogs!)

    We just upgraded to 1.7.1, so I am wondering if that had anything to do with this?

    Any tips ya’ll could provide would be spectacular!

    Thanks!
    Micky

  • #2 / Sep 09, 2011 9:34pm

    mhulse

    329 posts

    Could it be a cache problem?

    I noticed that the system cache folder’s permissions are set to 777, but there are several folders in there with 755 permissions (db_cache, page_cache, tag_cache).

    Should all of the folders in the cache folder have 777 permissions? Could this have anything to do with the “remember me” feature of the comments form? (my guess would be no, as I assume there is a cookie set on the client machine with no cache involved.)

    Thanks!
    Micky

  • #3 / Sep 10, 2011 4:25am

    jeramiah

    301 posts

    I’m actually having this problem as well.  Any one else have any idea what is going on?  User Session Type: Cookies and session ID.  My cache directory is 777.  Only in FF does it work, all other browsers it does not:  IE 8,9, Chrome.

  • #4 / Sep 10, 2011 8:11pm

    Sue Crocker

    26054 posts

    Hi, Micky.

    Are you using cookies only or cookies and sessions? Try cookies only and see what happens. Which browser on which operating environment are you working with?

  • #5 / Sep 11, 2011 3:42am

    mhulse

    329 posts

    Hello Sue! Thanks so much for your help, I really appreciate it. 😊

    We are using Cookies Only for both the admin and the front-end.

    I just tested on my Mac, OS X, 10.6.8 via these browsers:

    Opera Version 11.10
    Google Chrome 13.0.x
    Safari 5.1
    Firefox 6.0.2

    Part of me wonders if I am overlooking something?

    Jeramiah, thanks for chiming in! Let me know if you figure out what is causing the problem for you.

    Thanks again for the help Sue! I greatly appreciate it. 😊

    Cheers,
    Micky

  • #6 / Sep 12, 2011 6:54pm

    Dan Decker

    7338 posts

    mhulse,

    In your template code above, you have the tags for {notify_me} and {save_info} swapped.
    You have:

    <ul class="form_opts">
            {if logged_out}
                <li><input type="checkbox" id="fm_comment_notify_me" name="notify_me" value="yes" {save_info}> <span>Remember my personal information?</span></li>
            {/if}
            <li><input type="checkbox" id="fm_comment_save_info" name="save_info" value="yes" {notify_me}> <span>Notify me of follow-up comments?</span></li>
        </ul>

    Try:

    <ul class="form_opts">
            {if logged_out}
                <li><input type="checkbox" id="fm_comment_notify_me" name="notify_me" value="yes" {notify_me}> <span>Remember my personal information?</span></li>
            {/if}
            <li><input type="checkbox" id="fm_comment_save_info" name="save_info" value="yes" {save_info}> <span>Notify me of follow-up comments?</span></li>
        </ul>

    Does that clear up your issue?

    Cheers,

  • #7 / Sep 12, 2011 7:21pm

    mhulse

    329 posts

    Dan! Thanks for the code fix! :D

    I can’t believe I missed that!

    The updated code now reads:

    <ul class="form_opts">
        {if logged_out}
            <li><input type="checkbox" id="fm_comment_notify_me" name="notify_me" value="yes" {notify_me}> <span>Remember my personal information?</span></li>
        {/if}
        <li><input type="checkbox" id="fm_comment_save_info" name="save_info" value="yes" {save_info}> <span>Notify me of follow-up comments?</span></li>
    </ul>

    I dumped the cache and, unfortunately, that did not seem to help. :(

    Here’s the page in question (Note: meant for iPhone or Android… CSS not tested in all desktop browsers/platforms).

    This is the non-mobile version (which has always had the {notify_me} and {save_info} variables in the right spots).

    Here’s the code for the non-mobile version:

    {exp:comment:form cache="yes" refresh="999"}
        
        <div class="pseudoLegend"><h5>Post a comment</h5><p></div><br />
        <br />
        <fieldset><br />
            <legend class="hide">Post a comment</legend><br />
            <br />
            {if logged_out}<br />
                <br />
                <b>Attention:</b> <span class="required">*</span> indicates a required field.<br />
                <br />
                <div class="fm req"><br />
                    <label for="fm_comment_name"><span class="required">*</span> Your name:</label><br />
                    <input type="text" id="fm_comment_name" name="name" maxlength="50" value="{name}"><br />
                </div><br />
                <br />
                <div class="fm req"><br />
                    <label for="fm_comment_email"><span class="required">*</span> Your e-mail:</label><br />
                    <input type="text" id="fm_comment_email" name="email" maxlength="50" value="{email}"><br />
                </div><br />
                <br />
                <div class="fm"><br />
                    <label for="fm_comment_location">Location:</label><br />
                    <input type="text" id="fm_comment_location" name="location" maxlength="50" value="{location}"><br />
                </div><br />
                <br />
                <div class="fm"><br />
                    <label for="fm_comment_url">URL:</label><br />
                    <input type="text" id="fm_comment_url" name="url" maxlength="50" value="{url}"><br />
                </div><br />
                <br />
            {/if}<br />
            <br />
            <div class="fm"><br />
                <label for="fm_comment_comment">Comment:</label><br />
                <textarea id="fm_comment_comment" name="comment" cols="30" rows="15">{comment}</textarea><br />
            </div><br />
            <br />
            {if logged_out}<br />
                <br />
                <div class="fm box"><br />
                    <input type="checkbox" id="fm_comment_save_info" name="save_info" value="yes" {save_info}><br />
                    <label for="fm_comment_save_info">Remember my personal information?</label><br />
                </div><br />
                <br />
            {/if}<br />
            <br />
            <div class="fm box"><br />
                <input type="checkbox" id="fm_comment_notify_me" name="notify_me" value="yes" {notify_me}><br />
                <label for="fm_comment_notify_me">Notify me of follow-up comments?</label><br />
            </div><br />
            <br />
            {if captcha}<br />
                <br />
                Security captcha question:<br />
                {captcha}<br />
                <div class="fm"><br />
                    <input type="text" name="captcha" value="" maxlength="20"><br />
                </div><br />
                <br />
            {/if}<br />
            <br />
            <div class="horizRule"></div><br />
            <br />
            ...<br />
            <br />
            <div class="horizRule"></div><br />
            <br />
            <div class="submit"><br />
                <input class="submit" type="submit" name="submit" value="Submit"> <input class="submit" type="reset" name="reset" value="Reset"><br />
            </div><br />
            <br />
        </fieldset><br />
        <br />
    {/exp:comment:form}

    Wondering if there’s something with our server setup? Maybe I should build a stripped-down comments page, with no JS or styles, for testing?

    Thanks so much for the help! I greatly appreciate it!

    Cheers,
    Micky

  • #8 / Sep 13, 2011 3:42am

    John Henry Donovan

    12339 posts

    Hi Micky,

    Where did you get the following parameters from?

    {exp:comment:form dynamic="off" cache="yes" refresh="999"}

    try the following using the allowed parameters

    {exp:comment:form weblog="news" url_title="{segment_3}”}

  • #9 / Sep 13, 2011 4:23am

    mhulse

    329 posts

    Hi John!

    Thank you (& Sue & Dan) for all of the help! I greatly appreciate it!

    Thanks for catching those code errors… I think I was mixing-up the params for the comment:entries tag with the comment:form tag.

    I made those changes and still no love. :(

    I did find a glaring problem though… The “cookie domain”, via EE admin settings, is set to an IP address!!!!!

    I tried changing the setting back to our domain “.site.com”, but when I save, it reverts back to the IP address; even after changing config.php to 777 permissions, the IP address kept re-appearing. I had to manually change the cookie domain setting in config.php and now it looks like my form is setting cookies!

    Unfortunately, I am still having no luck getting the form to remember guest user information.

    I am sure that I am overlooking something. I will play with my code more tomorrow and report back my findings.

    Thanks again for all the help!

    Cheers,
    Micky

  • #10 / Sep 13, 2011 4:26am

    mhulse

    329 posts

    Unfortunately, I am still having no luck getting the form to remember guest user information.

    Wait! I take that back! The form is remembering me! WOOT! :D

    Looks like my problem is solved.

    Thanks to everyone for the help!

    Have a great day!

    Cheers,
    Micky

  • #11 / Sep 13, 2011 8:04am

    Dan Decker

    7338 posts

    Micky,

    That’s excellent news! I’m glad you were able to sort out this issue. If you need assistance in the future, feel free to start a new thread.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases