1
是否有任何sfWidgetFormSelectDoubleList
的驗證,並且當表單無效[!isValid()]時出現問題並使用以前的數據重新加載頁面。選項不顯示先前選擇的值,即使我在下次選擇某個值時我也沒有收到任何值。Symfony sfWidgetFormSelectDoubleList驗證
我的形式是這樣的
$this->setWidgets(array(
'event_title' => new sfWidgetFormInputText(),
'client_list' => new sfWidgetFormSelectDoubleList(array(
'choices' => $client,
'associated_first' => false,
'label_associated' => '',
'label_unassociated' => ''
)),
));
$this->setValidators(array(
'event_title' => new sfValidatorString(array('required' => true)),
));
//並在我的控制器
if($form1->isValid()){
$resource->title = $frmField['event_title'];
$resource->save();
//var_dump($frmField);
return $this->renderPartial('newEvent', array('form1' => $form1));
} else {
var_dump($frmField);
return $this->renderPartial('createEvent', array('form1' => $form1));
}
無法設置驗證,因爲我不知道它。並且完全不知道爲什麼它在第二次和第二次提交時沒有任何價值