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

[eluser]usmc[/eluser]
[quote author="johnmiller" date="1218154870"]i changed it like this

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

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

controller
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 still it is not working???

any idea???[/quote]

Change the input name to "txt_fname" as well (not just the id);


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