Welcome Guest, Not a member yet? Register   Sign In
Using form_dropdown with IDs and names
#5

[eluser]ivantcholakov[/eluser]
$team_dropdown is the variable that you have to pass from the to the view.
$team_id contains the currently selected item key of the dropdown.

Code:
// Controller

    $team_dropdown = $this->Matches_model->get_team_dropdown();

    $team_id = '';  // This is an initial value.
    // If there is a database record - assign the actual value of $team_id.

    $data = array(
        'team_dropdown' => $team_dropdown,
        'team_id' => $team_id,
        // etc.
    );

    $this->load->view('my_view_with_my_form', $data);


Messages In This Thread
Using form_dropdown with IDs and names - by El Forum - 04-10-2014, 11:39 AM
Using form_dropdown with IDs and names - by El Forum - 04-10-2014, 12:23 PM
Using form_dropdown with IDs and names - by El Forum - 04-10-2014, 12:41 PM
Using form_dropdown with IDs and names - by El Forum - 04-10-2014, 02:55 PM
Using form_dropdown with IDs and names - by El Forum - 04-10-2014, 03:08 PM
Using form_dropdown with IDs and names - by El Forum - 04-10-2014, 04:58 PM
Using form_dropdown with IDs and names - by El Forum - 04-13-2014, 11:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB