diff --git a/administrator/components/com_config/model/form/application.xml b/administrator/components/com_config/model/form/application.xml index a6242254cd649..24ce1441c2a78 100644 --- a/administrator/components/com_config/model/form/application.xml +++ b/administrator/components/com_config/model/form/application.xml @@ -727,12 +727,14 @@ name="lifetime" type="number" min="1" + step="1" default="15" label="COM_CONFIG_FIELD_SESSION_TIME_LABEL" description="COM_CONFIG_FIELD_SESSION_TIME_DESC" required="true" filter="integer" validate="number" + class="validate-range" size="6" /> value){ + return false; + } + + if(!isNaN(max) && max < value){ + return false; + } + + if(!isNaN(step) && value % step !== 0){ + return false; + } + + return true; + }); + }); +})(jQuery); diff --git a/media/com_config/js/validate-number.js b/media/com_config/js/validate-number.js new file mode 100644 index 0000000000000..3c9d42dad9a97 --- /dev/null +++ b/media/com_config/js/validate-number.js @@ -0,0 +1 @@ +(function(e){e(function(){document.formvalidator.setHandler("range",function(e,t){var n=parseFloat(t.prop("min")),r=parseFloat(t.prop("max")),i=parseFloat(t.prop("step"));return!isNaN(n)&&n>e?!1:!isNaN(r)&&r