Date format validation

MaiorovYury 05 May, 2013
Dear support,
I need your help to find a solution
So I have Chronoforms 4.0 RC3.5.2 installed on my Joomla 2.5.8 site.
And there I have a date input field. This is the code for it

<div class="clear"></div><div id="error-message-ward"></div></div><div class="ccms_form_element cfdiv_datetime" id="birth_date1_container_div" style=""><label>Дата рождения</label><input maxlength="150" size="16" class=" validate['required','target:birth_date_clone_id'] cf_date_picker" title="" type="text" value="" name="birth_date" />

The problem is that I guess some users use some tools to fill this form up and the date then is filled with value in different format (it also sends me an email with this data, so I can see that it was filled). And then the database doesn't recognize this as a correct date and saves 0000-00-00. I actually made a test myself using LastPass extension in Firefox and that's exactly what happened to me.

Do you know of a way to overcome this? Maybe a script to validate that this date value is in correct format? Because I believe all it does not is checking that the field is filled with some (any) data.

Thank you in advance!
GreyHead 12 May, 2013
Hi MaiorovYury,

There are a few choices here - you could make the date input readonly with a little JavaScript to prevent auto-completion. Or you could add a custom validation to the element.

This topic is locked and no more replies can be posted.