我正在尝试从使用 CActiveForm 小部件创建的表单中检索数据。但是,当我单击提交按钮时,没有数据写入目标 URL。如何获取提交的表单数据?
<p>Please list the ages of the members of your household:</p>
<div class="form offset3">
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'survey',
'enableClientValidation' => true,
'enableAjaxValidation' => true,
'action'=>Yii::app()->createUrl('//survey_resp'),
'clientOptions' => array(
'validateOnSubmit' => true,
),
'htmlOptions' => array(
'class' => 'form-horizontal',
),
));
?>
<div class="row">
<?php echo $form->labelEx($model, 'age_1'); ?>
<?php echo $form->textField($model, 'age_1'); ?>
<?php echo $form->error($model, 'age_1'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model, 'age_2'); ?>
<?php echo $form->textField($model, 'age_2'); ?>
<?php echo $form->error($model, 'age_2'); ?>
</div>
<div class="row rememberMe">
<?php echo $form->checkBox($model, 'resp_re'); ?>
<?php echo $form->Label($model, 'resp_re'); ?>
<?php echo $form->error($model, 'resp_re'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('submit'); ?>
</div>
<?php $this->endWidget(); ?>