Avatar of GessWurker
GessWurker
 asked on

Fix validation so dates without trailing text fail validation

I need to prevent "orphan dates" being submitted in form. The attached form is prevents bad dates from being submitted, but it does not block entries that contain ONLY a date. All lines should have a valid date followed by some text.

Example: A line that only has a date, like this:

·12/12/2019

Should not pass validation.

These lines are good:

·10/23/2019 - test
·10/24/2019 - testing again

Here is test content (note, the bullet character must be included):

·10/23/2019 - test
·10/24/2019 - testing again
·10/01/2019 - here's another test
·12/03/2019 - sort this one too
·12/1/2019 - bad date should be caught
·12/12/2019
·12/x/2019

By the time all validation is done, all acceptable entries (i.e., valid date followed by text) should be accepted and properly sorted.

Who can help with this validation issue?

Thanks!
sort_test.htm
JavaScript

Avatar of undefined
Last Comment
GessWurker

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ste5an

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
GessWurker

ASKER
Perfect! Thanks!
GessWurker

ASKER
Did the trick!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy