You must Sign In to post a response.
  • Category: JavaScript

    Javascript to clear dropdownlist items?

    Hi All,

    How to clear items in dropdownlist using javascript? Script Please...

    Thanks,
    Jeni
  • #160716
    var len = objComboCtrl.options.length;
    for(i=len-1; i>=0; i--)
    {
    objComboCtrl.options.remove(i);
    }

  • #160727

    public void clear()
    {
    foreach (Control ct in form1.Controls)
    {

    (ct is DropDownList)
    {
    ((DropDownList)ct).SelectedIndex = 0;
    }

    }
    }


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.