load 2nd combo box against first combo box onchange event

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ranjitbd
Forum Newbie
Posts: 24
Joined: Sun May 03, 2009 1:59 pm

load 2nd combo box against first combo box onchange event

Post 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.
 
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

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

Post 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?
Post Reply