I'm key in '1000asdf' on input text.
Like this one :
================
public function testAction(){
$form = new My_Form_Project_Test();
if($this->_request->isPost()){
print_r($this->_request->getPost());
}else{
echo $form;
}
}
and the output like this :
Array ( [test] => 1000asdf [submit] => Submit )
=====
Thanks, bn
________________________________
From: Matthew Weier O'Phinney [mailto:[EMAIL PROTECTED]
Sent: Sel 04-Nop-2008 23:06
To: [email protected]
Subject: Re: [fw-general] Filter Digits on Zend_Form
-- Bagus Nugroho <[EMAIL PROTECTED]> wrote
(on Tuesday, 04 November 2008, 10:18 PM +0700):
> I'm trying using 'Digits' filter on Zend_Form like this :
> ======
> class My_Form_Project_Test extends Zend_Form{
> public function __construct($options = null){
> parent::__construct($options);
>
> $update = new Zend_Form_Element_Text('test');
> $update->setLabel('Test')
> ->addFilter('Digits');
>
>
> $submit = new Zend_Form_Element_Submit('submit');
> $submit->setLabel('Submit');
>
>
> $this->addElements(array($update, $submit));
> }
> }
>
> then, when input '1000asdf', I'm expecting get '1000' but the code above give
> me '1000asdf' instead of '1000' as expected.
> Is any wrong with my code above.
How are you retrieving the element value?
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/