|
本帖最后由 julia 于 2011-1-8 05:21 编辑
———- controllers
if ($this->input->post(‘submit’)==‘change’ or $this->input->post(‘submit’)==‘change2’) {
echo ‘submit ‘.$this->input->post(‘submit’);
...
}
———- views
[removed]
function submit2()
{
var s=document.getElementById("ops");
alert(s.value); //显示正确
document.form.submit('change2'); //没有执行通常的 submit 返回 controllers
}
[removed]
<?php echo form_open_multipart(site_url($this->uri->uri_string()),array(‘name’ => ‘form’, ‘id’ => ‘form’)); ?>
type <?php echo form_dropdown(‘type_id’, $type, $this->session->userdata(‘type_id’), ‘id=“ops” onChange=“submit2()”’) ?> //这里没有回到controllers
<input type="submit" name="submit" value="change" > //这里回到controllers
...
</form> |
|