0
我正在使用zend框架開展一個項目,我需要通過狀態選擇來加載一個動態Ajax城市。每個狀態都與數據庫中的城市相關聯。Zend Form Dynamic Ajax City Loading
我有一個表格Create.php class Application_Form_Create extends Zend_Form {
public function init() {
$this->setMethod('POST');
...
$state = new Zend_Form_Element_Select('state');
$state->setLabel('States:')
->addMultiOptions($DataBaseStatesArray);
$this->addElement($state);
$city = new Zend_Form_Element_Select('city');
$city->setLabel('Cities:')
->addMultiOptions($DataBaseCitiesArray);
$this->addElement($city);
$submit = new Zend_Form_Element_Submit('submit');
$this->addElement($submit);
}
形式加載到查看器
... function createAction(){ $this->view->form = new Application_Form_Create(); }
查看
<?=$this->form;?>
我如何可以加載基於城市使用zend框架資源選擇狀態?
感謝
好吧,我這樣做不過Zend的形式validade阿賈克斯插入的數據和「城市」說,在草垛 – dextervip 2011-02-10 20:27:38