I am having issue when using below code in plugin xml.
maxlength is not working.
< field name="phone" type="text" default="" label="Phone" description="Phone: Must not be greater than 13 numbers" maxlength="13" />
or
< param name="phone" type="text" default="" label="Phone" description="Phone: Must not be greater than 13 numbers" maxlength="13" />
Please let me know what need to be done or i am doing wrong.
Thanks in advance.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-02-27 09:23:34 |
Hi,
I am not sure that it is a bug in Joomla 2.5 version. but i checked that in libraries\joomla\html\parameter\element\text.php in function fetchElement, the maxlength attribute is not being added in input field. I just added it as below.
public function fetchElement($name, $value, &$node, $control_name){
$size = ($node->attributes('size') ? 'size="' . $node->attributes('size') . '"' : '');
$maxlength = ($node->attributes('maxlength') ? 'maxlength="' . $node->attributes('maxlength') . '"' : '');
$class = ($node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="text_area"');
$value = htmlspecialchars(htmlspecialchars_decode($value, ENT_QUOTES), ENT_QUOTES, 'UTF-8');
return '
. ' ' . $size . ' ' . $maxlength . ' />';
}
Hi,
Your right maxlength clearly has never been implemented in JParameter or JForm in 2.5 or 3.x. If you wish to submit a code to implement this I'm sure it will be gratefully accepted and probably implemented :)
Labels |
Added:
?
|
Please use the google group for questions. See https://groups.google.com/forum/#!forum/joomla-dev-general
This is not a support forum.