Welcome Guest, Not a member yet? Register   Sign In
dynamic dropdownbox using ajax
#1

[eluser]max123[/eluser]
How can i create dynamic dropdownbox using ajax. That means there are 2 dropdown boxes. items in the 2nd dropdown box depends on the selection of the 1st drop down box. Please help me. It is urgent

Thanx a lot
#2

[eluser]saidai jagan[/eluser]
For ex,
The sub category list box depends on the category list.
If the category list is selected, send the Id through ajax and get the sub categories based on the category Id by the query then show the values.
Use jquery,CI
#3

[eluser]rogierb[/eluser]
Take a look at jquery.com

Code:
$("select[name=select_numero_1]").change(function(){get_select_2($(this).val()});

function get_select_2($select_1_value)
{
$.ajax({
    type: "POST",
    url: "<?php echo base_url()?>ajax/get_select2",
    data: { select_value:$select_1_value},
        async: false,
                dataType: "json",
                success: function(msg){
                    //msg is a json object you can use to populate you select with
                 }
        });
}
#4

[eluser]max123[/eluser]
how can i do it with codeigniter. Please tell me from the very beginning. is there any good tutorial. If so please send me the link. I know how to do it without the CI frame work. But I want it to be done using CI. Please help me.
#5

[eluser]rogierb[/eluser]
In CI it is the same as without CI.
You include jquery. In your ajax call, you call a controller that parses som information back.

Or take a look here: http://www.mrforbes.com/thoughts/2009/01...-tutorial/
or here http://geekhut.org/2009/06/how-to-codeig...uery-json/
or here http://blufusion.net/2009/07/30/easy-aja...deigniter/
#6

[eluser]iron-man[/eluser]
you can easilly do it in rabbitform

see www.rabbitform.com/wiki
www.rony012.wordpress.com/rabbitform


Thanking u
Rony




Theme © iAndrew 2016 - Forum software by © MyBB