ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Validate a calendar field with a custom javascript code

hilmata 02 Feb, 2018
Hello. I'm trying to perform a verification for my calendar field but my javascript code don't work. I want my field to display an error message when the user put a date greater than today's one.

jQuery.fn.form.settings.rules.verifdatecreation = function(value, param) {

var currentDate = new Date().setHours(0,0,0,0);
var selectedDate = new Date(value);

if (selectedDate > currentDate) {
return false;
}else{
return true;
}
};
Max_admin 10 Feb, 2018
Answer
Hi tchaabid,

You do not need to validate this, open the calendar advanced settings and set the "End date" to:
{date:Y-m-d}
This will restrict the date selection to end on the same day.

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com