Forums

Date validation doesn't work thoroughly

jane808 09 Mar, 2017
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 10 Mar, 2017
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
jane808 11 Mar, 2017
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 11 Mar, 2017
Hi Jane808,

I'm not clear how that would be helpful?

Bob
jane808 13 Mar, 2017
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 13 Mar, 2017
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
jane808 13 Mar, 2017
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 14 Mar, 2017
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
astewart 05 Jan, 2018
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.
Max_admin 08 Feb, 2018
1 Likes
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, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
astewart 09 Feb, 2018
1 Likes
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!
This topic is locked and no more replies can be posted.