我将输入数据传递给我的控制器,如下所示:
if ($this->input->post('submit') === 'renew_prepaids_submit'){
if($this->affiliates_model->renew_doctor_pp($user_id, $this->input->post())){
$type = $this->input->post('type');
$amount = $this->input->post('amount');
$pp_type = $this->input->post('doctor_case_fee_type');
$doctor = $this->users_model->get_user($user_id);
$doctor = object_to_array($doctor);
$this->fastbraces_email->pp_mailer($doctor,$type,$amount );
}
redirect('/cases/thank_you');
}
包含表单模板的视图:
<? $this->load->view('client/templates/form_horizontal', $prepaid_renewal_data); ?>
我要做的是,不是做重定向,而是首先让提交按钮调用模式进行验证,如下所示:
<div id="create-visit-modal" class="modal hide fade create-visit-modal" tabindex="-1" role="dialog" aria-labelledby="create-visit-modal" aria-hidden="true" style="display: block;">
<div class="modal-header">
<button type="button" class="close" style="margin-top:-8px;" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<h1>Attention:</h1>
<p style="text-align:justify;"></b>
No returns or exchanges will be accepted. If you have any questions please call .
</p>
</div>
<div class="modal-footer">
<a class="btn btn-success" style="float:left" href="https://dev.fastbraces.com/cases/renew_pp/664">Submit</a>
<button class="btn btn-primary create-visit-modal-btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
<style>
#alert{visibility: hidden !important; position: absolute;}
</style>
因此,表单会将输入数据传递给模态,然后模态会将输入数据传递给控制器等。