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 7750679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:21:10+00:00 2026-06-01T11:21:10+00:00

I have the dropdown list like this <?php echo $form->dropdownList($customers,’customer_name’, CHtml::listData(Customers::model()->findAll(), ‘id’, ‘customer_name’), array(

  • 0

I have the dropdown list like this

   <?php echo $form->dropdownList($customers,'customer_name', CHtml::listData(Customers::model()->findAll(), 'id', 'customer_name'),
 array(
   'ajax'=> array(
             'type'=>'GET',
             'url'=>
             'data'=>
           ),
             'empty'=>--Select One---')); ?>

another link for creating a new customer is like this

 <?php echo CHtml::link('Create Customers', "",array(
        'style'=>'cursor: pointer; text-decoration: underline;',
        'onclick'=>"{addCustomers(); $('#dialogCustomers').dialog('open');}"));?>

I want the create customer link should come inside dropdown list.So how to place create customer link inside the dropdown list,how to merge the both links and create them into a single one?.Any help and suggestions will be highly appreciable.

  • 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-06-01T11:21:12+00:00Added an answer on June 1, 2026 at 11:21 am

    Tbh i’m not really sure what you’re trying to do, but from what i got you need something like this:

    echo $form->dropDownList(
        $customers,
        'customer_name',
        CMap::mergeArray(
            CHtml::listData(
                Customers::model()->findAll(), 'id', 'customer_name'
            ),
            array(
                'create_customer_link'=>'Create new customer'
            )
        ),
        array(
            'empty'=>array('Select'=>'--Select One---'),
            'id'=>'Customers_name',
            'ajax'=> array(
                'type'=>'GET',
                'beforeSend'=>'js:function(){
                    if($("#Customers_name").val() == "create_customer_link") {
                        addCustomers();
                        $("#dialogCustomers").dialog("open");
                        return false;
                    }
                }',
                'url'=>...
                'data'=>...
            ),
            'options'=>array(
                'create_customer_link' => array('class'=>'my_custom_css_class'),
                // ... etc. You can add any html option here.
                // check http://www.yiiframework.com/doc/api/1.1/CHtml#dropDownList-detail for more info
            )
        )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi I have this gridview like this. <asp:DropDownList ID=triggerDropDown runat=server AutoPostBack=true onselectedindexchanged=triggerDropDown_SelectedIndexChanged> <asp:GridView ID=myGridView
I have a dropdown list (FK) which I would like to set and display
I have a dropdown list. I am using onchange event of this dropdown to
I have a select list like the following inside of a form. <select name=0[voicemail]
I have the jquery code below that returns a list of ID's like this
I'm looking to create a similar combobox or dropdown list like this where the
I have a category table like this: I can list categories as list and
I have a simple PHP Array called $categories that looks like this: Array (
I have a select list like such: <select name=taxonomy[1][] multiple=multiple class=form-select id=edit-taxonomy-1 size=7> <option
I have a simple form that has a list (dropdown list generated from a

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.