000
000

Reputation: 3950

Digit validation in Zend form array notation

I do not know what to write for digits validation in the below code:

$row_form = new Zend_Form(array(
        'elements' => array(
            'fldName' => array(
                'type' => 'text',
                'options'=> array(
                                   'size'=>'15',
                                   'maxlength' => '8',
                                  ),
                'validators'=> array(

                  //Digits Validation

            ) 
            ),
        ),
    ));

PS: I want to maintain the array notation

Upvotes: 0

Views: 1743

Answers (3)

Ram Ch. Bachkheti
Ram Ch. Bachkheti

Reputation: 2639

Try this:

->setFilters(Array('Digits'));

Upvotes: 0

voodoo417
voodoo417

Reputation: 12101

add array('Digits') like following

'validators'=> array('Digits') 

Upvotes: 3

000
000

Reputation: 3950

$row_form = new Zend_Form(array(
        'elements' => array(
            'fldName' => array(
                'type' => 'text',
                'options'=> array(
                                  'size'=>'15',
                                  'maxlength' => '8',
                                  'validators'=> array('Digits'),
                                  ),

            ),
        ),
    ));

Upvotes: 1

Related Questions