Multiple input fields search

#1
[eluser]the_unforgiven[/eluser]
Hi all,

Help needed here:

I want to provide a form that has two input fields, date & time one field is called 'from' the other is called 'to' and also need to get the options from a dropdown menu that is pre-populated.

So if the user inputs a from and to date/time then selects a option from the dropdown I want it to search then database to match these and return the results, with pagination based on 15 results per page.

Code in my controller is here -> http://pastie.org/8505391

But it's not working and my form looks like this -> http://pastie.org/8505394

Really could do with some help on this please....

#2
[eluser]varta.shrimali@convonix.com[/eluser]
Use following HTML code in view for "from" and "to" input fields :

Code:
<input type="text" class="form-control" name="from_field" id="from_field" class="form-control" placeholder="Date From" value="">

<input type="text" class="form-control" name="to_field" id="to_field" class="form-control" placeholder="Date To" value="">

And to access the post variables in controller :

Code:
$from = $this->input->post('from_field');
$to = $this->input->post('to_field');


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.