Commit 2393562a authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch '5392-datetime-invalid-message' into 'master'

Feature #5392 - Violate message with expected date format

See merge request !36
parents 7215931f 31ae89df
......@@ -3177,7 +3177,6 @@ abstract class AbstractBuildForm {
// 'maxLength' needs an upper 'L': naming convention for DB tables!
$attribute .= $this->getAttributeList($formElement, ['size', 'maxLength']);
$attribute .= Support::doAttribute('value', htmlentities($value), false);
$attribute .= $this->getAttributeList($formElement, [F_FE_DATA_PATTERN_ERROR, F_FE_DATA_REQUIRED_ERROR, F_FE_DATA_MATCH_ERROR, F_FE_DATA_ERROR]);
if ($formElement[FE_PLACEHOLDER] == '') {
$timePattern = ($formElement[FE_SHOW_SECONDS] == 1) ? 'hh:mm:ss' : 'hh:mm';
......@@ -3198,6 +3197,10 @@ abstract class AbstractBuildForm {
$formElement[FE_PLACEHOLDER] = $placeholder;
}
if ($formElement[F_FE_DATA_PATTERN_ERROR] == '')
$formElement[F_FE_DATA_PATTERN_ERROR] = "Please match this format: $placeholder";
$attribute .= $this->getAttributeList($formElement, [F_FE_DATA_PATTERN_ERROR, F_FE_DATA_REQUIRED_ERROR, F_FE_DATA_MATCH_ERROR, F_FE_DATA_ERROR]);
$attribute .= $this->getAttributeList($formElement, [FE_INPUT_AUTOCOMPLETE, 'autofocus', 'placeholder']);
$attribute .= Support::doAttribute('data-load', ($formElement[FE_DYNAMIC_UPDATE] === 'yes') ? 'data-load' : '');
$attribute .= Support::doAttribute('title', $formElement[FE_TOOLTIP]);
......
......@@ -798,6 +798,8 @@ class Support {
}
self::setIfNotSet($formElement, FE_DECIMAL_FORMAT);
self::setIfNotSet($formElement, F_FE_DATA_PATTERN_ERROR);
return $formElement;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment