CodeIgniter Forums
casecade dropdown - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: casecade dropdown (/thread-23190.html)

casecade dropdown - El Forum - 10-03-2009

hai everybody

I want to load a selectbox based on another selectbox selected value. For example load state selectbox based on selected country. can anyone help me, its is very urgent for me.

thanks before

casecade dropdown - El Forum - 10-04-2009

do you use dynamic or static select box?

casecade dropdown - El Forum - 10-04-2009

Thanks for the reply.

I use dynamic selectbox. For that i used this code,

<select id="country">ajax->remote_function(array('update' => 'state', 'url' => "/test/index.php/test/testfun/"); ?&gt;">
<option value="1">India</option>
<option value="2">Australia</option>

<select id="state">


This function work properly, but i dont know how to get and pass the country id to testfun function.

casecade dropdown - El Forum - 10-05-2009

try with this.

function reload(form){
var val=form.cuntry.options[form.cuntry.options.selectedIndex].value;
self.location=index.php?cuntry=' + val;
and just add input function like...
@$cuntry = $_GET['cuntry'];

if(strlen($cuntry) > 0 and !is_numeric($cuntry))
    echo "Data Error 2";

That may help! 8-/

So you have $cuntry as a number,and you can manipulate with it!