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

XF 1.3 Please select valid time zone error on register page

Discussion in 'Troubleshooting and Problems' started by bcercan, Sep 20, 2014.

  1. bcercan

    bcercan Active Member

    Hello,

    I've just edited my register_form template to remove birthday and gender selection. And know there is only Username, E-mail, Password, Pasword Confirm and Captcha fields.

    The problem is when I try to register I filled all fields but it gives an error like "please select valid time zone"

    What I'm missing?
     
  2. Mike

    Mike XenForo Developer Staff Member

    If it happened after an edit you made, it may imply that you made an additional change or an incompatible change. You may wish to revert the change and try again, being sure you know what you're removing.
     
    bcercan likes this.
  3. bcercan

    bcercan Active Member

    Oh I found it. I didn't see that I removed this part:

    Code:
    <dl class="ctrlUnit" style="display: none">
            <dt><label for="ctrl_timezone">{xen:phrase time_zone}:</label></dt>
            <dd>
                <select name="timezone" class="textCtrl {xen:if $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_timezone">
                    <xen:foreach loop="$timeZones" key="$identifier" value="$name">
                        <option value="{$identifier}" {xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
                    </xen:foreach>
                </select>
            </dd>
        </dl>
    Thanks
     
  4. Beanjam

    Beanjam Active Member

    I am getting this too on 1.5 sometimes during testing and I can't figure out why. That timezone code does still exist in the template, but it's not displayed to the user. Could it be something to do with using my browser's incognito mode when doing test signups? Even then, it's still at random and doesn't happen every time.

    In this case it actually reset all the data I entered too.

    signup-error.JPG
     
  5. Mike

    Mike XenForo Developer Staff Member

    To take customizations out of the equation, please confirm whether you can reproduce it (even sporadically) with the default/unmodified file and with add-ons disabled.

    If so, that may point to your session not being maintained, which could indicate not enough space in a cache (if you have enabled sessions in the cache) or your IP changing (either on your end or via a proxy).
     
  6. Fethi.dz

    Fethi.dz Member

    Hello,

    @Mike This error still exist, no modification on templates or on style.

    I found in the register_form template the flowing part that controls showing the time zone in registration form been hidden by a css code (style="display: none") so that's why we get this error. Same error can be reproduced by directly clicking on Accept the terms and rules and hit Register :

    PHP:
        <dl class="ctrlUnit" style="display: none">
            <
    dt><label for="ctrl_{$fieldMap.timezone}">{xen:phrase time_zone}:</label></dt>
            <
    dd>
                <
    select name="{$fieldMap.timezone}class="textCtrl {xen:if $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_{$fieldMap.timezone}">
                    <
    xen:foreach loop="$timeZoneskey="$identifiervalue="$name">
                        <
    option value="{$identifier}{xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
                    </
    xen:foreach>
                </
    select>
            </
    dd>
        </
    dl>
     
  7. Mike

    Mike XenForo Developer Staff Member

    Hiding it doesn't cause the issue. The value is still sent to the server.

    We haven't had any other reports of this that didn't involve one of the things discussed above, so please ensure you can confirm the issue on a 100% default style and no add-ons. (If you can, can you confirm it on a demo?)
     
  8. Fethi.dz

    Fethi.dz Member


    Correcting my previous reply to make it clear so you can reproduce the error.

    1. Go to the registration form
    2. Go directly without filling any info to the bottom, thick on "I agree to the terms and rules." and click Sign up
    3. Refresh the page from the browser ... You will get the Error list and you will find in the list (7.Please select a valid time zone.)

    As you said, the value still sent to the server even the field of time zone is hidden, so the error shouldn't show up at all.
     
    Beanjam likes this.
  9. Beanjam

    Beanjam Active Member

    Following the above, I can see the error happening here on 1.5.8
     
  10. Mike

    Mike XenForo Developer Staff Member

    This is the problem and ultimately expected. The registration form uses a changing key which helps thwart automated registrations. By refreshing the page, the submitted data is using the old key and thus not picked up.
     
  11. Fethi.dz

    Fethi.dz Member

    If the field not mandatory and always selected & hidden, why that error message appears. I think it should be removed from data submission checking.
     

Share This Page