我正在使用 Zend Form 创建动态表单.
I am using Zend Form to create dynamic form.
我也有 Zend Form 验证.
I have Zend Form validation too.
尝试动态删除验证,但没有任何成功.
Trying to remove Validation dynamically, but not getting any success.
你能帮我删除 Zend 验证吗.
Can you plz help me to remove Zend Validation.
Bellow 是我的删除验证代码:
Bellow is my code for remove validation :
$toRemValArray = array();
$toRemValArray[0] = 'ele_4af42ceac7810';
if(isset($_POST['btnPost_x'])){
if ($form->isValid($_POST)) {
$allElements = $form->getElements();
foreach($allElements as $val){
if(in_array('ele_4af42ceac7810',$toRemValArray)){
$value = $form->getElement($val->getName());
$value->removeValidator('ele_4af42ceac7810');
}
}
}
}
让我知道我的代码是否有任何问题
Let me know whether my code is having any issue
谢谢穆罕默德·塔雷克
您应该删除调用 $form->isValid() 的验证器BEFORE.
You should remove the validator BEFORE calling $form->isValid().
这篇关于Zend 表单验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
PHP、MySQL PDOException 的死锁异常代码?Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死锁异常代码?)
PHP PDO MySQL 可滚动游标不起作用PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滚动游标不起作用)
PHP PDO ODBC 连接PHP PDO ODBC connection(PHP PDO ODBC 连接)
使用 PDO::FETCH_CLASS 和魔术方法Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔术方法)
php pdo 只从 mysql 获取一个值;等于变量的值php pdo get only one value from mysql; value that equals to variable(php pdo 只从 mysql 获取一个值;等于变量的值)
MSSQL PDO 找不到驱动程序MSSQL PDO could not find driver(MSSQL PDO 找不到驱动程序)