diff --git a/forms/DateField.php b/forms/DateField.php index 123e60077..e313d3db2 100755 --- a/forms/DateField.php +++ b/forms/DateField.php @@ -205,7 +205,7 @@ class DateField extends TextField { if(Validator::get_javascript_validator_handler() == 'none') return true; - if($this->showSeparateFields) { + if($this->getConfig('dmyfields')) { $error = _t('DateField.VALIDATIONJS', 'Please enter a valid date format (DD/MM/YYYY).'); $error = 'Please enter a valid date format (DD/MM/YYYY) from dmy.'; $jsFunc =<<getField()->getConfig('showcalendar')) { // Inject configuration into existing HTML $format = self::convert_iso_to_jquery_format($this->getField()->getConfig('dateformat')); - $this->getField()->addExtraClass(str_replace('"', '\'', Convert::raw2json(array('dateFormat' => $format)))); + $conf = array( + 'showcalendar' => true, + 'dateFormat' => $format + ); + $this->getField()->addExtraClass(str_replace('"', '\'', Convert::raw2json($conf))); } } diff --git a/javascript/DateField.js b/javascript/DateField.js index 05ae32f6c..ee3b8713a 100644 --- a/javascript/DateField.js +++ b/javascript/DateField.js @@ -1,6 +1,7 @@ (function($) { $('.field.date input.text').live('click', function() { var holder = $(this).parents('.field.date:first'), config = holder.metadata(); + if(!config.showcalendar) return; if(config.locale && $.datepicker.regional[config.locale]) { config = $.extend(config, $.datepicker.regional[config.locale], {});