Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:18:42+00:00 2026-05-30T08:18:42+00:00

Using this wiki I have a dynamic dropdownlist working just fine. Instead of the

  • 0

Using this wiki I have a dynamic dropdownlist working just fine. Instead of the related data populating another dropdownlist I just want all the related values to display at once on the screen in some sort of formatted list.

I changed the update in the ajax action to 'update'=>'#cities', and added to my view…

<div id="cities"> 
   <?php echo $model->relatedCities; ?>
</div 

and to my model

public function getRelatedCities()
{
   $out=CHtml::listData($this->cities,'CityId','Name');
   return implode('<br />', $out);
}

When I make my selection in my dropdownlist nothing is updated in <div id="cities"> and the ajax call in firebug looks fine.

So how can I display the dynamic related content from the dropdownlist all at once?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:18:43+00:00Added an answer on May 30, 2026 at 8:18 am

    This is a problem with your action, you have to echo instead of return.

    Because your ajax call is expecting html data, and not some string.

    So try this:

    public function getRelatedCities()
    {
     $out=CHtml::listData($this->cities,'CityId','Name');
     echo implode('<br />', $out);
    }
    

    p.s: Assuming that you have verified that $out is not empty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this jQuery plugin: http://code.google.com/p/jqueryrotate/wiki/Documentation I have the plugin working and everything,
I have built a multilingual website with CodeIgniter using this library: http://codeigniter.com/wiki/URI_Language_Identifier/ I use
I followed the steps using this site : http://wiki.apache.org/nutch/RunNutchInEclipse I encountered a problem while
I followed this tutorial: https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf However, I can't seem to set the path right.
I am using 'git' to checkout chromium code by following this document: http://code.google.com/p/chromium/wiki/UsingGit And
I am using Magento community ver1.6.1.0. I found this state diagram on Magento wiki
Using this page, http://developer.android.com/sdk/compatibility-library.html , I have installed the Android Support Package, added a
Using this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/ I have created sample/hello world application on the windows phone
I'm using Ruby on Rails to develop a web application. I have a wiki
I am using this multilanguage addon http://codeigniter.com/wiki/CodeIgniter_2.1_internationalization_i18n to make available my codeigniter sites in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.