addElement('hidden', 'productId'); $this->addElement('numeric', 'quantity', array('label' => 'Quantity:', 'required' => true, 'precision' => 0)); $this->getElement('quantity')->addValidator('GreaterThan', false, 0); $this->getElement('quantity')->getValidator('GreaterThan')->setMessage( 'Quantity must be greater than zero', Zend_Validate_GreaterThan::NOT_GREATER ); $this->getElement('quantity')->addValidator('Int'); return $this; } protected function _initButtons() { $this->addElement( 'submit', 'btnSubmit', array( 'label' => 'Add To Cart', 'attribs' => array('class' => 'btn') ) ); return $this; } }