setRegisterInArrayValidator function is not working in zend
In order to dynamic form validation handling in Zend framework we use “setRegisterInArrayValidator”. But few days back i have observed this fuction was showing me with new Zend library. With new Zend library if we write
$form = new Admin_Form_Form1();
$form->getElement(‘form_element’)->setRegisterInArrayValidator(false);
It gives the error
“Invalid type given, value should be float, string, or integer”
To resolve this problem we can use we can use the alternative function that works properly with even new Zend library. The new function will be
$element->removeValidator(“NotEmpty”);
in other words
$form->getElement(‘form_element’)->removeValidator(“NotEmpty”);
Where “NotEmpty” is validation type.
Chandra Shekhar
Latest posts by Chandra Shekhar (see all)
- Best practices for micro service design - January 23, 2022
- Spring Boot - January 23, 2022
- Java - January 23, 2022
Recent Comments