[eluser]Julia Yan[/eluser]
the purpose is form_dropdown onchange to get submit return to controllers. but it does not work
------- controllers
if ($this->input->post('submit')=='change' or $this->input->post('submit')=='change2') {
echo 'submit '.$this->input->post('submit');
...
}
------- views
Code:
[removed]
function submit2()
{
var s=document.getElementById("ops");
alert(s.value); //work here
document.form.submit('change2'); //does not go to controllers for submit
}
[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()"') ?>
...
</form>