The issue is: It loads the selected index value alright in the first environement.
It does not send it in the second, MVC codeigniter. The controller does not get the selected index that before load did send.
1st one WORKS: Look how easy is to understand.
//jquery code for source list
$(document).ready(function()
{
$('#sel_pais').change(function()
{
if ($(this).val()!='')
{
$("#sel_source").load("includes/getchilds5.php",{pais_id: $(this).val()});
}
});
}); // end of first function
=========================================================
getchilds5.php file
if(isset($_REQUEST['pais_id']) && !empty($_REQUEST['pais_id'])) {
$result = mysql_query("select * from tabla_from where pais_id='".$_REQUEST['pais_id']."' ");
if(mysql_num_rows($result) > 0) {
echo '<option value="">Select</option>';
while($row = mysql_fetch_assoc($result)) {
echo '<option value="'.$row['id_from'].'">'.$row['from_name'].'</option>';
}
} else {
echo '<option value="">Select</option>';
}
} # end of IF ISSET FOR PAIS
======= Now MVC It does not work, because the controller is not getting the value:
$(document).ready(function()
{
$('#country').change(function()
{
if ($(this).val()!='')
{
$("#source").load("/CI-3/application/controllers/control_form.php/",{pais_id: $(this).val()},
}
});
}); // end of first function
</script>
============================================================
<?php echo form_open('control_form/add_all'); ?>
<label for="country">Country<span class="red"></span></label>
<select id="country" name="country">
<option value="">Select</option>
<?php
foreach($result as $row)
{
echo '<option value="' . $row->pais_id . '">' . $row->pais_name . '</option>';
}
?>
</select>
<label for="source">Source Language<span class="red"></span></label>
<!--this will be filled based on the tree selection above-->
<select id="source" name="source">
<option value="">Select</option>
<?php
===============================================================
The controller would do this:
$pais_id = $this->input->get_post('country', TRUE); # but I am not getting anything
but it gets an empty object