The date format is confusing. The required format is (yyyy/mm/dd) we would like mm/dd/yyy. How can I change this?
Respectfully,
Len
Respectfully,
Len
Hi Len,
The validation code was originally borrowed from a Australian script. Seems they believe that the US format is confusing.
You can fix this by hacking the code code. Open up components/com_chronocontact/js/jsvalidation2.js and add the extra code block marked here at around line 162.
This will let you put the validate-date-us into an input class to validate a date as mm/dd/yyyy
Otherwise you could add a custom LiveValidation in the Form JavaScript box. I'm pretty sure that has been posted here before.
Bob
The validation code was originally borrowed from a Australian script. Seems they believe that the US format is confusing.
You can fix this by hacking the code code. Open up components/com_chronocontact/js/jsvalidation2.js and add the extra code block marked here at around line 162.
if(field.hasClass('validate-date-au')){
if( tmessage) { var message_validate_date_au = tmessage; }
name.add( Validate.Format, {
pattern: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.](19|20)[0-9][0-9]$/,
failureMessage: message_validate_date_au
});
fieldsarray[fieldsarray_count] = name;
fieldsarray_count = fieldsarray_count + 1;
}
/* add the code snippet from here. . . */
if(field.hasClass('validate-date-us')){
if( tmessage) { var message_validate_date_us = tmessage; }
name.add( Validate.Format, {
pattern: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)[0-9][0-9]$/,
failureMessage: message_validate_date_us
});
fieldsarray[fieldsarray_count] = name;
fieldsarray_count = fieldsarray_count + 1;
}
/* . . . to here */
if(field.hasClass('validate-currency-dollar')){
This will let you put the validate-date-us into an input class to validate a date as mm/dd/yyyy
Otherwise you could add a custom LiveValidation in the Form JavaScript box. I'm pretty sure that has been posted here before.
Bob
This did not work. It's still telling people to enter their Date of Birth as yy/mm/day when it validates.
Any ideas?
Respectfully,
Len
Any ideas?
Respectfully,
Len
Hi Len,
It should work, try to clear your browser and website caches ?
Cheers,
Max
It should work, try to clear your browser and website caches ?
Cheers,
Max
This topic is locked and no more replies can be posted.