Welcome Guest, Not a member yet? Register   Sign In
Help -passing textbox value to controller
#1

[eluser]johnmiller[/eluser]
this is my textbox

Code:
<input type="text" id="txt_fname" name="txt_fname" />

this is my button
Code:
<?php
    $this->load->helper('form');
    echo form_open('blog/do_search',array('fname' => 'txt_fname'));
  ?>
    <input type="submit" name="button" id="button" value="Search" /></form>

in the controller, i wrote

Code:
function do_search()
    {
      $first_name = $this->input->post('fname');
      $this->load->model('search_model');
      $data['search_details'] =  $this->search_model->search($first_name);
      $this->load->view('search_results', $data);
    }

but i am not getting $first_name value in the model. that means, the value is not passing from view to controller.

where i am making mistakes???
can you please help me?


Messages In This Thread
Help -passing textbox value to controller - by El Forum - 08-07-2008, 12:44 PM
Help -passing textbox value to controller - by El Forum - 08-07-2008, 01:06 PM
Help -passing textbox value to controller - by El Forum - 08-07-2008, 01:21 PM
Help -passing textbox value to controller - by El Forum - 08-07-2008, 01:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB