Welcome Guest, Not a member yet? Register   Sign In
Carry form element value to button or link
#3

[eluser]eedfwChris[/eluser]
You could only use redirect if you are not trying to submit other form data fields (because redirect doesn't send the post variables AGAIN). So you could do:
Code:
function do_style()
{
    switch ($this->input->post($radio_box_value)
    {
        case 'create':
            $this->create_style();
            break;
        case 'view':
            $this->view_style();
    }
}

function create_style()
{
    ...
}

function view_style()
{
    ...
}
The disadvantage to this is that you don't get a specific URL/URI like it may be ideal. For example, you have do_style() which has no real meaning but you may idealy want to have create_style() instead. This, again, can be solved by using redirect() but this doesn't allow you to work with POST data in the redirect.

Also, keep in mind the redirect kinda makes the browser history screwy so only use it when you are certain it should exist and the user is unlikely to hit "back" in their browser.


Messages In This Thread
Carry form element value to button or link - by El Forum - 09-13-2007, 11:19 AM
Carry form element value to button or link - by El Forum - 09-13-2007, 12:54 PM
Carry form element value to button or link - by El Forum - 09-15-2007, 01:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB