2009年11月13日星期五

Re: [fw-mvc] Changing the size attribute of a validationtextbox element

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr9j5AACgkQkCAxuhXMpxVqcgCdGuMVzME0zYNm19KOfVGBzNTj
fO8AnApnNQ0J7GsVKFkm3d9l728Jr1n/
=tBll
-----END PGP SIGNATURE-----

Andrew Sledge napsal(a):
Hello all,

This is in relation to Zend_Form.  Apparently I'm missing the obvious, but how do you change the size attribute of a ValidationTextbox element?

Here is my element

$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
));

I want the input element to have the size attribute to have 8.  Any and all help is most appreciated.

--
Andrew Sledge
$this->addElement('ValidationTextBox', 'name', array(
'label'      => 'Name:',
'required'   => true,
'filters'    => array('StringTrim'),
'regExp' => $regex,            
'validators' => array(
array('Regex',false,array('/^'.$regex.'$/'))
),
'decorators' => array(
array('DijitElement', array('maxlength' => 1)),
'Errors',
array('HtmlTag', array('tag' => 'div')),
array('Label', array('tag' => 'div')),
array('Description', array('tag' => 'div')),
),
'dijitParams' => array(
    maxLength => 8
),
'style' => 'width: 100px'
));

Dijit ValidationTextBox doesn't support size, you can setup CSS with property

没有评论: