Can a dropdown selection trigger a popup?

  •  03-03-2006, 7:18 PM

    Can a dropdown selection trigger a popup?

    I am trying to use javascript to pop a window based on an item selection in a custom dropdown.
     
    protected void Page_Load(object sender, System.EventArgs e)
    {
     // Put user code to initialize the page here
     Ajax.Utility.RegisterTypeForAjax(typeof(EditContent));
            
            Editor.AutoConfigure = CuteEditor.AutoConfigure.Default;
            if (!IsPostBack)
            {
                  CuteEditor.ToolControl toolctrl = Editor.ToolControls["CustomItems"];
                  if (toolctrl != null)
                  {
                       CuteEditor.RichDropDownList dropdown = (CuteEditor.RichDropDownList)toolctrl.Control;
       
                       //Add the onchange attribute to the dropdown to call my custom function
                       dropdown.Attributes["onchange"] = "DropDownChange(this)";
                       //the first item is the caption       
                       CuteEditor.RichListItem richitem = dropdown.Items[0];
                       //clear the items from configuration files       
                       dropdown.Items.Clear();
                       //Add the items and values to the list
                       dropdown.Items.Add(richitem);
       
                       //Add the new items to the drop down
                       dropdown.Items.Add("Insert Footer Info","Insert Footer Info");
                       dropdown.Items.Add("Insert Header Info", "Insert Header Info");
                  }
            }
    }
     
    function DropDownChange(element)
    {
     //check element for desired values
     alert(element);
     alert(element.value);
     alert(element.toString());
     alert(element.name);
    }
     
    Of course I don't want to just alert the values, but at that point I should be able to see the values that were past over, but I dont.  All of the alert box's say eith '0' or "undefined'.  Is there abetter way to do this?
     
    Thanks
     
     
View Complete Thread