Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2008
    Posts
    174
    Plugin Contributions
    0

    Default "Verify your age" not working on tablets or i-phones

    Good morning;

    Using Responsive Classic template. One of my customers pointed this out to me, when you go into "login" on my website to set up an account, it ask you to verify your age. When I do this on my desktop, I'm able to put the age in as MM/DD/YYYY. However when you go into "login" on a tablet or i-phone, it gives you a calendar. It then does not like the calendar age and will not let you log in. I checked the error logs for my website and there is nothing there for this. What setting do I need to change or is there an error in the code somewhere?

    Thank you,

    David

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,424
    Plugin Contributions
    94

    Default Re: "Verify your age" not working on tablets or i-phones

    Quote Originally Posted by pazdar View Post
    Good morning;

    Using Responsive Classic template. One of my customers pointed this out to me, when you go into "login" on my website to set up an account, it ask you to verify your age. When I do this on my desktop, I'm able to put the age in as MM/DD/YYYY. However when you go into "login" on a tablet or i-phone, it gives you a calendar. It then does not like the calendar age and will not let you log in. I checked the error logs for my website and there is nothing there for this. What setting do I need to change or is there an error in the code somewhere?

    Thank you,

    David
    I'm remembering an iOS date-related issue in the past. You can add some debug code to /includes/functions/functions_dates.php (around line 60):
    Code:
    function zen_valid_date(string $date, string $format = DATE_FORMAT): bool
    {
        trigger_error("zen_valid_date($date)");
        // Build 3 formats from 1 with 3 possible separators
        $format0 = str_replace('-', '/', $format);
        $format1 = str_replace('/', '-', $format);
        $format2 = str_replace(['/','-'], '', $format);
        $d0 = DateTime::createFromFormat('!' . $format0, $date);
        $d1 = DateTime::createFromFormat('!' . $format1, $date);
        $d2 = DateTime::createFromFormat('!' . $format2, $date);
        return ($d0 && $d0->format($format0) == $date) || ($d1 && $d1->format($format1) == $date) || ($d2 && $d2->format($format2) == $date);
    }
    Once that's added, give the create-account another try and post the logged results.

  3. #3
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    225
    Plugin Contributions
    7

    Default Re: "Verify your age" not working on tablets or i-phones

    It seems the calendar returns a date in the "YYYY/MM/DD" format.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,424
    Plugin Contributions
    94

    Default Re: "Verify your age" not working on tablets or i-phones

    Quote Originally Posted by pilou2 View Post
    It seems the calendar returns a date in the "YYYY/MM/DD" format.
    Thanks for that, @pilou2.

  5. #5
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    225
    Plugin Contributions
    7

    Default Re: "Verify your age" not working on tablets or i-phones

    Actually, it is more complicated than that. The date format provide by the iPhone date picker depends on 'language and region' settings.
    I tried few variation on my old iPhone, iOS 15, and got those results:
    - Region USA, language English -> June 21 2025
    - Region France, language French -> 21 juin 2025
    - Region Japan, language whatever -> 2025/06/21
    On new iPhones with iOS 17, there is a separate setting for date format which might help if set on numeric format but anyway, these are completly independant of Zen Cart language/regional settings...
    Last edited by pilou2; 21 Jun 2025 at 05:33 AM.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,424
    Plugin Contributions
    94

    Default Re: "Verify your age" not working on tablets or i-phones

    Quote Originally Posted by pilou2 View Post
    Actually, it is more complicated than that. The date format provide by the iPhone date picker depends on 'language and region' settings.
    I tried few variation on my old iPhone, iOS 15, and got those results:
    - Region USA, language English -> June 21 2025
    - Region France, language French -> 21 juin 2025
    - Region Japan, language whatever -> 2025/06/21
    On new iPhones with iOS 17, there is a separate setting for date format which might help if set on numeric format but anyway, these are completly independant of Zen Cart language/regional settings...
    Were those results the date returned by the form or the date displayed by the form?

    From my read of the HTML specification on the date field (https://html.spec.whatwg.org/multipa...id-date-string) the value returned is of the form YYYY-MM-DD.

  7. #7
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    225
    Plugin Contributions
    7

    Default Re: "Verify your age" not working on tablets or i-phones

    Quote Originally Posted by lat9 View Post
    Were those results the date returned by the form or the date displayed by the form?

    From my read of the HTML specification on the date field (https://html.spec.whatwg.org/multipa...id-date-string) the value returned is of the form YYYY-MM-DD.
    The date displayed by the form. And of course they failed the validation.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,424
    Plugin Contributions
    94

    Default Re: "Verify your age" not working on tablets or i-phones

    Quote Originally Posted by pilou2 View Post
    The date displayed by the form. And of course they failed the validation.
    OK, but in all cases, was the value returned in YYYY-MM-DD format? That would, most likely, fail validation as well.

  9. #9
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    225
    Plugin Contributions
    7

    Default Re: "Verify your age" not working on tablets or i-phones

    Quote Originally Posted by lat9 View Post
    OK, but in all cases, was the value returned in YYYY-MM-DD format? That would, most likely, fail validation as well.
    I think so, I don't really know how to check that on iPhone. But if I use a Japanese ZC set to Japanese which accepts the date format YYYY/MM/DD, then I am able to create an account even with the displayed date in French format like '21 juin 2025'.

 

 

Similar Threads

  1. "Forgot your password" not working
    By ekele in forum General Questions
    Replies: 3
    Last Post: 26 Jan 2011, 08:17 PM
  2. How can I remove or delete "Verify your age" ?
    By ttmb33 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 May 2009, 07:39 PM
  3. How do you remove "verify your age" from registration?
    By HTMLGoddess in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 16 Apr 2009, 09:27 AM
  4. Verify Your Age field
    By rfresh in forum Managing Customers and Orders
    Replies: 1
    Last Post: 8 Jan 2009, 07:43 AM
  5. "Add this to your cart" button not working
    By dazbusby in forum General Questions
    Replies: 11
    Last Post: 3 Nov 2008, 08:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR