Page 1 of 1

load 2nd combo box against first combo box onchange event

Posted: Tue Dec 08, 2009 12:24 am
by ranjitbd

Code: Select all

 
// i am using codeigniter frame work 
// in my view page a combo box where the local city name is present.
    <select name="city" id="city" class="textBoxStyle" style="width:100">
            <option value="">Select One</option>
            <option value="all">All</option>
                <?php
                  foreach ($package_name as $destination){?>
                    <option value="<?php echo $destination['id'];?>"><?php echo $destination['city_name'];?>
            </option>
                <?php } ?>
       </select>
 
// and a radio button that is
    <input name="holiday_type" type="radio" value="2"/>International Holiday
// when the user will click on the radio button the combo box will show the international
//city_name from the database using ajax..
 
// i dnt know how to execute ajax with codeigniter but i can do it using raw php. 
// thanks in advance.
 

Re: load 2nd combo box against first combo box onchange event

Posted: Tue Dec 08, 2009 12:00 pm
by kaszu
AJAX - asynchronous javascript + xml (usually plain HTML or JSON instead of XML)
i dnt know how to execute ajax with codeigniter
AJAX is technique for client side (javascript), not server side.

What exactly is your question? How to create AJAX call and fill <select> or how to return data (XML, HTML or JSON) with CodeIgniter?