mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
patterns for text inputs
This commit is contained in:
parent
11e0c99e74
commit
e263d9a0c5
@ -2288,6 +2288,7 @@ function html_print_input_text_extended(
|
||||
'autocomplete',
|
||||
'form',
|
||||
'list',
|
||||
'pattern',
|
||||
];
|
||||
|
||||
$output = '<input '.($password ? 'type="password" autocomplete="'.$autocomplete.'" ' : 'type="text" autocomplete="'.$autocomplete.'"');
|
||||
@ -2579,6 +2580,9 @@ function html_print_input_password(
|
||||
* @param integer $maxlength Maximum length allowed (optional).
|
||||
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
|
||||
* @param boolean $disabled Disable the button (optional, button enabled by default).
|
||||
* @param string|null $list Some stuff.
|
||||
* @param string|null $placeholder Some stuff.
|
||||
* @param string|null $pattern Some stuff.
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
@ -2601,7 +2605,8 @@ function html_print_input_text(
|
||||
$onKeyUp='',
|
||||
$disabled=false,
|
||||
$list='',
|
||||
$placeholder=null
|
||||
$placeholder=null,
|
||||
$pattern=null
|
||||
) {
|
||||
if ($maxlength == 0) {
|
||||
$maxlength = 255;
|
||||
@ -2650,6 +2655,10 @@ function html_print_input_text(
|
||||
$attr['placeholder'] = $placeholder;
|
||||
}
|
||||
|
||||
if ($pattern !== null) {
|
||||
$attr['pattern'] = $pattern;
|
||||
}
|
||||
|
||||
return html_print_input_text_extended(
|
||||
$name,
|
||||
$value,
|
||||
@ -4641,7 +4650,8 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
||||
((isset($data['onKeyUp']) === true) ? $data['onKeyUp'] : ''),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['list']) === true) ? $data['list'] : ''),
|
||||
((isset($data['placeholder']) === true) ? $data['placeholder'] : '')
|
||||
((isset($data['placeholder']) === true) ? $data['placeholder'] : ''),
|
||||
((isset($data['pattern']) === true) ? $data['pattern'] : null)
|
||||
);
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user