hi i am using jquery ui autocomplete combobox plugin , i am creating a combobox initially in document.ready
jQuery('#combolist_city').combobox();
i set some options when page is loading
<select id="combolist_city" class="city" name="search[city]">
<option value="0">Select city</option>
<?php
if(isset($city_list))
{
foreach($city_list as $city_data)
{
if(isset($selected_city) && ($selected_city == $city_data['CityID']))
{
echo "<option selected='selecetd' value=".$city_data['CityID'].">".$city_data['CityName']."</option>";
}
else
{
echo "<option value=".$city_data['CityID'].">".$city_data['CityName']."</option>";
}
}
}
?>
</select>
now i want to change his options, i am tying to do it by
jQuery("#combolist_city").combobox({
initialValues: ['aaa','bbb','ccc']
});
but it is not working , it is not recreating the options ,
how can i do this , please help………………………..
You have to do it manually. First destroy the combobox and empty the select. Append the new options and build the combobox again:
Also see this example.