How do I capture the "Codes" drop down "SelectedIndexChanged" event?

  •  05-19-2005, 10:24 AM

    How do I capture the "Codes" drop down "SelectedIndexChanged" event?

    Hello,

    How do I capture the "Codes" drop down "SelectedIndexChanged" event? on the server or the client side?

    Thanks,

    PS: I am open to suggestions (Server or Client solution).  Here is what I tried to do:


            private void PopulateMergeFields()
            {
                if(Editor1.ToolControls["Codes"]!=null)
                {
                    CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)Editor1.ToolControls["Codes"].Control;
                    
                    //the first item is just the caption
                    CuteEditor.RichListItem richitem=dropdown.Items[0];

                    //clear the items from configuration files
                    //see Configuration/Shared/Common.config
                    dropdown.Items.Clear();

                    //add the caption - Codes
                    dropdown.Items.Add(richitem);

                    ArrayList list = GetMergeFields();

                    for(int i = 0; i < list.Count; ++i)
                        dropdown.Items.Add(listIdea [I].ToString(), listIdea [I].ToString());

                    dropdown.Attributes["onchange"]="CuteEditor_DropDownCommand(this,'PastHTML')";
                }
            }




    And on the Html page, I added the following javascript function:

    <script language="javascript">
        function CuteEditor_DropDownCommand(element,caption)
        {
            //if the SelectedItem.Value == "[xyz]" then open a popup
            // so that the user can select more merge fields ...
            window.open('http://www.yahoo.com', 'Advanced Merge Fields');
        }
    </script>

    However, this doesn't work.  When I click on the drop down I get:


View Complete Thread