Php Zend Framework 1-提交按钮不起作用(单击后无帖子)
此表单中的所有功能都可以工作—获取最大余额和贷方余额、会话功能等。但是,单击submit按钮时,什么都不做。它应该由该表单所在页面的控制器进行处理,但还没到那个程度。没有要求职位。如果有人能帮助我,我将不胜感激Php Zend Framework 1-提交按钮不起作用(单击后无帖子),php,zend-framework,zend-form,Php,Zend Framework,Zend Form,此表单中的所有功能都可以工作—获取最大余额和贷方余额、会话功能等。但是,单击submit按钮时,什么都不做。它应该由该表单所在页面的控制器进行处理,但还没到那个程度。没有要求职位。如果有人能帮助我,我将不胜感激 <?php class Application_Form_Redeem extends Zend_Form { protected $identity; public function init() { //make sure it doesn't accept a n
<?php class Application_Form_Redeem extends Zend_Form
{
protected $identity;
public function init()
{
//make sure it doesn't accept a number greater than available balance
$this->identity = Zend_Auth::getInstance()->getIdentity();
$username=$this->identity->username;
$users = new Application_Model_DbTable_User();
$creditBal=$users->getCreditBal($username);
//make sure it doesn't accept a number greater than maxRedemption
$sess = new Zend_Session_Namespace('BusinessID');
$retailerID = $sess->id;
//echo "RETAILERID: " . $retailerID;
$partners = new Application_Model_DbTable_Partners();
$maxRedemption= $partners->getMaxRedemption($retailerID);
// Create a validator chain and add validators to it
$validatorChain = new Zend_Validate();
$validatorChain
->addValidator(new Zend_Validate_GreaterThan(array('min' => 0,)))
->addValidator(new Zend_Validate_LessThan(array('max' => $creditBal+0.01,)))
->addValidator(new Zend_Validate_LessThan(array('max' => $maxRedemption+0.01,)))
;
$this->setMethod('post');
$this->setName('Redeem-form');
$this->setAttribs(array('style' => 'text-align:left;position:relative;'));
$this->addElement('text', 'redeemAmount', array(
'label' => ' n',
'class' => 'redemptionAmount',
'size' => '15',
'required' => true,
'validators' => array(
array(
'validator' => $validatorChain,
),
),//end validators aray
));
$this->addDisplayGroup(array(
'redeemAmount',
),'redemptionAmount', array('legend' => ''));
$this->addElement('submit', 'submitRedemption', array(
'ignore' => true,
'class' => 'redeem',
'label' => 'Redeem ',
));
$this->addDisplayGroup(array(
'submitRedemption',
),'submitRedemption', array('legend' => ''));
}
如果表单甚至没有发布,那么PHP代码就没有问题。您可以提供显示此表单的页面的URL,或者包含HTML/模板源的相关部分吗?通过HTML验证程序运行HTML也是值得的。我看不到任何setAction('/path/to/action')
,通常也看不到它们在单击时没有发生的原因。