Setting default value through javascript

Discussion in 'C#' started by manavsm, Sep 1, 2010.

  1. manavsm

    manavsm New Member

    Joined:
    Sep 1, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    i want to change the default value of dropdown list to 0 i.e selected index value shud become 0 when press the cancel button so that watever i selected previously is removed
    i want it in javascipt only...i have done it in c#...since there s no forum for javascript i posted here only

    here is the javsacript
    Code:
        function CloseDiv() {
                var control = document.getElementById("divReqStages");
                control.style.visibility = "hidden";
                var control1 = document.getElementById('DDLReqStages').selectedIndex;
                control1.value='0';
             
            }
    
    here s the asp code....when i click here the drop down shud be reset
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice