• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form URI

Hi, i'm trying to get my url to show something like this when the user submits a form:


Here's my view:
echo form_open('results');
echo form_dropdown('city', $city);
echo form_dropdown('brand', $brand);
echo form_dropdown('model', $model);
<input type="image" src="<?php echo base_url();?>images/search.png"  alt="Submit button" />
echo form_close();

How can i do it?

[eluser]Rok Biderman[/eluser]
Well, there are 2 ways about it that seem reasonable to me. First is to do an action that takes values from the form and then redirects it. The other way I can think of is to build the action attribute using js (jquery). I think that it's all clientside so it should work.

function redirect()
          $city = $this->input->('city');
        $brand = $this->input->('brand');
        $model =$this->input->('model');
                redirect ('controller/yourfunction/' . $city . '/' . $brand . '/' . $model)

For js variant this link should get you started


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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