title: Codeigniter: passing a value from jquery to the controller
body: <p>I have decided to split my questions into parts to make it much more easier to understand:</p>
  
  <p>The first issue is:</p>
  
  <p>I have interdependent select lists, so I am going to be working with jquery</p>
  
  <p>I have this snippet which gets me the id of the selected option:</p>
  
  <pre><code>    //jquery code for source list
      $(document).ready(function(){
      $('#f_state').change(function() {
        if ($(this).val()!='') {
          $("#f_city").load("./controller/control_form.php",{pais_id: $(this).val()});
        }
      // or should I use something like this instead..
  
  var post_url = "./controllers/control_form/" + $(this).val();
  
  but still dont know how to fetch at the controller
          });
  
      });
  </code></pre>
  
  <p>but..how do I actually send it to the controller ? Or from other point of view ? how do I retrieve it from the controller ? I have done it out of CI scenario, but in codeigniter ..don't know.</p>
  
  <p>The thing is that if I manage to grab it at the controller, I can pass that index to the Model. The model would do the sql query and would yield an array back to the controller and from there I would print it back to the view to populate that second dropdown list.</p>
  
  <p>thank you</p>
  
  <p>regards</p>
  
  <p>A</p>