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 1088295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:03:12+00:00 2026-05-16T23:03:12+00:00

I have a very large Form with many date fields that need to be

  • 0

I have a very large Form with many date fields that need to be validated. For the most part, this is pretty straight-forward to do with the jQuery Validation plug-in. But I have found a use-case, where I am not exactly sure that the “correct” design decision is:

I have a date-field whose value is by default an abstract example :

<input id="date_field" name="date_1" class="" type="text" value="tt.mm.jjjj" maxlength="10"/>

I want this field to be optional. So in the validator option I declare:

date_field:         {date: true}

Ofcourse this isn’t correct, because if the user hasn’t entered anything and thus left the default “dd.mm.yyyy” value, the validator will check to see if the value is a date, which it’s not and throw an error.

I could write my own custom date validator that just adds the “dd.mm.jjjj” to the list of correct dates.
But in a different use case in the same form, I have a field that is both a date and required. If I used the custom validator on this field, then the form would validate even if the user hasn’t entered anything on his own. But because the custom validator allows for the “dd.mm.jjjj” String to be accepted , and that string field is obviously not empty, the form would be accepted.

So, the way I see it the optimal solution would be to “extend” the cases that the validator interprets a field as beeing empty.

In other words I would like to say to the validator: “Hey, date fields are also empty if they have this string as a value”.

Unfortunatelly my jQuery/ Javascript skills are somewhat limited and my attemts have so far failed to construct anything like the above.

On the other hand, this must be a pretty common problem but I haven’t found a documented solution to it. So maybe I am missing something?

Thank you!

  • 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-05-16T23:03:13+00:00Added an answer on May 16, 2026 at 11:03 pm

    I ended up just extending jQuery Validator with my own custom “required” rule, just like the localization of “date” does. Was pretty obvious:)

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

Sidebar

Related Questions

I have a very large file that looks like this (see below). I have
I have a very large code base that contains extensive unit tests (using CppUnit).
We have some very large data files (5 gig to 1TB) where we need
I have a very large codebase (read: thousands of modules) that has code shared
I have a very large C project with many separate C files and headers
We have a very large existing site that we're going to do a completely
I have a very large (~6GB) SVN repository, for which I've written a batch
I have a very large app, 1.5 million lines of C++, which is currently
Here at work we have a very large application with multiple sub applications. (500
Is it particularly bad to have a very, very large SQL query with lots

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.