Buy Now
Sign in

Date validation doesn't work thoroughly

jane808 , March 09 2017
J
jane808
I have Chronoform V5. The date validation doesn't work for the following scenarios.
1. If use Text Box as date field with settings --> Mask: mm/dd/yyyy; Validation Required: Yes
* user can enter date as 02/01/yyyy or 10/dd/yyyy

2. If use Datepicker Box for date field with settings --> Format: m/d/Y; Validation Required: Yes
* user can pick a date and go back to the field delete the date was picked
GreyHead
Hi jane808,

1. Yes, that is correct, the mask does no validation; and Validation required just says that the input can't be left empty. You would need to add a custom validation to check if the date itself is valid - but that is not a simple task :-(

2. I can't replicate this - it's correct that the date can be deleted, but when I test the form can't be submitted with the date filed empty.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
J
jane808
2. if you use a required DatePicker box to select a date, then delete all numbers and leave the hyphens- or slash/, then you should still be able to submit thou.
GreyHead
Hi Jane808,

I'm not clear how that would be helpful?

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
J
jane808
The whole point is the DatePicker validation doesn't work if user mess around with the entry. And that's what we're trying to prevent because we did received some forms like that.
GreyHead
Hi jane808,

What you said was " then delete all numbers and leave the hyphens- or slash/, then you should still be able to submit . . ." I guess that isn't what you meant?

If necessary you can add serverside validation to check the date (and any other key values).

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
J
jane808
You said you couldn't replicate the issue that's why I told you the process on how to replicate it. Any way, thank you for your quick response, I think I can use javascript to validate the field before submission.
GreyHead
Hi Jane808,

I guess that you meant to say ". . . then you should *not* be able to submit . . ." that makes sense. Serverside validation would prevent that, or, as you suggest, custom JavaScript.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
A
astewart
Same issue here.
As an example, if Datepicker field is populated and there was an error on Submit with another required field or the captcha, it clears the Datepicker field and doesn't retain the previous selection. They are then able to submit it again while it is left blank after the second time, which it shouldn't since it is set to be a "Required Field".

This causes the Value to be "INVALID DATE", which we need to figure out how to get this to work properly.

Any ideas?

Thanks guys.
admin
Hi astewart,
I suggest testing this case in a small form with the calendar field and the captcha only, let us know if this has a problem.
Best regards
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
A
astewart
Actually I did work with someone from your support team on this and he figured out what was causing the issue, a JS issue cause by the ghost field for the Calendar Picker.
I think that what it was.
Either way, all good now guys.
Thanks for the great support!