Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9089893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:15:01+00:00 2026-06-16T22:15:01+00:00

Read EDIT 2 at bottom Original post: I have this jQuery validator method to

  • 0

Read EDIT 2 at bottom
Original post:

I have this jQuery validator method to check for a valid YYYY-MM-DD date:

$.validator.addMethod("myDate", function(value, element){

    var validformat = /^\d\d\d\d\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])$/;
    return validformat.test(value);

}, "Please enter a valid YYYY-MM-DD date");

It works fine on my computer – returns false when expected and true when expected. However, on my Android phone it always returns false – the input always says “Please enter a valid YYYY-MM-DD date” even when the date is valid.

Do any regex methods such as .test() work differently on Android (and possibly other phones), or is this a jQuery Validator bug?

EDIT: I have tried changing validformat.test(value) to value.match(validformat) with the same result – works on computer, not on phone.

EDIT 2: Ok even commenting everything else out inside the method and typing return true; still yields the error on my phone. Definitely a jQuery validator problem. Need a workaround though!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:15:02+00:00Added an answer on June 16, 2026 at 10:15 pm

    I have just checked on an Android 2.3 phone. It works perfectly.

    Therefore, I blame it on Android 2.2 only. So here’s my little fix:

    $("#myform").validate({
    ...
        <?php
        //only print out the rule into the JS if it's not Android 2.2
        if(!strpos($_SERVER['HTTP_USER_AGENT'], "Android 2.2"))
            print "myDate: true, \n";
        ?>
    

    Annoying hacks 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have attached data at the bottom of this post. I have output from
EDIT This is my file reader, can I make this read it from bottom
I've read posts about why you can't have a (Edit -- generic) (which use
EDIT: Please, please , please read the two requirements listed at the bottom of
I read up on this article about Perlin Noise and have a few questions
EDIT: Read the bottom of my question to see what I actually did. I
I have read looked through some code that implements tabs on the bottom of
EDIT: This method actually works great and I asked it then found the solution
EDIT: If you can't be bothered to read this mammoth question, I've put a
TL;DR at bottom of post I am building an application for mobile OS. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.