Welcome Guest, Not a member yet? Register   Sign In
casecade dropdown

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

do you use dynamic or static select box?

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.

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!

Theme © iAndrew 2016 - Forum software by © MyBB