Welcome Guest, Not a member yet? Register   Sign In
How to handle two submit buttons with two destinations ?
#4

[eluser]louis w[/eluser]
Use one destination but name them differently.

Code:
<input type="submit" name="do_edit" value="EDIT" />
<input type="submit" name="do_delete" value="DELETE" />

The value for the button will only get submitted for the one you click on.
Then in your controller test against it:

Code:
if ($this->input->post('do_delete') == 'DELETE') {
    // DELETE
} if ($this->input->post('do_edit') == 'EDIT' {
    // EDIT
} else {
    // WHOOPS
}


Messages In This Thread
How to handle two submit buttons with two destinations ? - by El Forum - 06-18-2008, 09:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB