diff --git a/lam/lib/html.inc b/lam/lib/html.inc
index 99daf20e..7ccbe71f 100644
--- a/lam/lib/html.inc
+++ b/lam/lib/html.inc
@@ -455,6 +455,10 @@ class htmlInputField extends htmlElement {
protected $sameValueFieldID = null;
/** marks the input field as auto trimmed (remove spaces at start/end) */
protected $autoTrim = true;
+ /** minimum value */
+ protected $minValue = null;
+ /** maximum value */
+ protected $maxValue = null;
/**
* Constructor
@@ -505,6 +509,14 @@ class htmlInputField extends htmlElement {
if ($this->validationRule != null) {
$validators[] = 'custom[' . $this->validationRule . ']';
}
+ $min = '';
+ if ($this->minValue !== null) {
+ $min = ' min="' . $this->minValue . '"';
+ }
+ $max = '';
+ if ($this->maxValue !== null) {
+ $max = ' max="' . $this->maxValue . '"';
+ }
// print input field
$class = '';
if (sizeof($validators) > 0) {
@@ -533,6 +545,9 @@ class htmlInputField extends htmlElement {
if ($this->isPassword) {
$inputType = 'password';
}
+ elseif (($this->minValue !== null) || ($this->maxValue !== null)) {
+ $inputType = 'number';
+ }
$disabled = '';
if (!$this->isEnabled) {
$disabled = ' disabled';
@@ -549,7 +564,8 @@ class htmlInputField extends htmlElement {
if (!empty($this->title)) {
$title = ' title="' . $this->title . '"';
}
- echo '';
+ echo '';
// autocompletion
if ($this->autocomplete) {
echo "