Commit bf686278 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

feat(attributes) Use tel input type for phone number fields

issue #5910
parent b2de7a98
......@@ -110,8 +110,9 @@ class phoneSelectDialog extends GenericDialog
*/
class PhoneNumberAttribute extends TestValidateAttribute
{
protected $trim = TRUE;
protected $testFunc = 'is_phone_nr';
protected $trim = TRUE;
protected $testFunc = 'is_phone_nr';
protected $inputType = 'tel';
}
/*! \brief Displays a text field and a button to select the phone from object list
......
......@@ -27,6 +27,7 @@ class StringAttribute extends Attribute
protected $example;
protected $autocomplete = NULL;
protected $trim = FALSE;
protected $inputType = 'text';
/*! \brief The constructor of StringAttribute
*
......@@ -69,7 +70,7 @@ class StringAttribute extends Attribute
if ($this->autocomplete !== NULL) {
$attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off' );
}
$display = $this->renderInputField('text', $id, $attributes);
$display = $this->renderInputField($this->inputType, $id, $attributes);
return $this->renderAcl($display);
}
......
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