Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. dropdownlist in java script

dropdownlist in java script

Scheduled Pinned Locked Moved ASP.NET
csharpjavajavascriptdatabasetools
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sonia Gupta
    wrote on last edited by
    #1

    how should i do with the dropdownlist in javascript.Like the selected-index , selected value , items.count functions in c#? actually i wanted to use the dropdownlist functions in javascript.

    Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

    A I A 3 Replies Last reply
    0
    • S Sonia Gupta

      how should i do with the dropdownlist in javascript.Like the selected-index , selected value , items.count functions in c#? actually i wanted to use the dropdownlist functions in javascript.

      Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

      A Offline
      A Offline
      Arindam Tewary
      wrote on last edited by
      #2

      Dear Sonia Gupta, Its a ASP .NET forum ..... it is good that you post it in javascript forum of web development forum In javascript...considering your drop down list controls ID is 'dddCountry' ....... objDropDownList = document.getElementById('dddCountry') int selectedIndex=objDropDownList.selectedIndex; var SelectedText = objDropDownList.options[selectedIndex].text; var SelectedValue = objDropDownList.options[selectedIndex].value; ... Hope it helps ... :rolleyes:

      Thanks, Arindam D Tewary

      S 1 Reply Last reply
      0
      • A Arindam Tewary

        Dear Sonia Gupta, Its a ASP .NET forum ..... it is good that you post it in javascript forum of web development forum In javascript...considering your drop down list controls ID is 'dddCountry' ....... objDropDownList = document.getElementById('dddCountry') int selectedIndex=objDropDownList.selectedIndex; var SelectedText = objDropDownList.options[selectedIndex].text; var SelectedValue = objDropDownList.options[selectedIndex].value; ... Hope it helps ... :rolleyes:

        Thanks, Arindam D Tewary

        S Offline
        S Offline
        Sonia Gupta
        wrote on last edited by
        #3

        how can i count the total items in the dropdownlist using the java script.

        Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

        A A 2 Replies Last reply
        0
        • S Sonia Gupta

          how can i count the total items in the dropdownlist using the java script.

          Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

          A Offline
          A Offline
          Arindam Tewary
          wrote on last edited by
          #4

          objDropDownList.options.length returns the length of items collection!!!

          Thanks, Arindam D Tewary

          1 Reply Last reply
          0
          • S Sonia Gupta

            how should i do with the dropdownlist in javascript.Like the selected-index , selected value , items.count functions in c#? actually i wanted to use the dropdownlist functions in javascript.

            Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

            I Offline
            I Offline
            Imran Khan Pathan
            wrote on last edited by
            #5

            Sonia Gupta wrote:

            selected-index

            ddl.options.selectedIndex

            Sonia Gupta wrote:

            selected value

            var month=ddl.options.selectedIndex;

            Sonia Gupta wrote:

            items.count

            dd.items.Length

            bEst rEgard pAthan

            please don't forget to vote on the post that helped you.

            1 Reply Last reply
            0
            • S Sonia Gupta

              how should i do with the dropdownlist in javascript.Like the selected-index , selected value , items.count functions in c#? actually i wanted to use the dropdownlist functions in javascript.

              Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

              A Offline
              A Offline
              Arif patel
              wrote on last edited by
              #6

              To create a select menu like dropdownlist(select) you can use the following code:

              Select a page JavaScript Numbers Strings Navigation Colors JavaScripter.net

              Just change the menu items and the corresponding URLs to whatever you want. You can use absolute URLs (like http://www.javascripter.net) as well as relative URLs (like mypage.htm). Regards, S.Arif patel Mind Source Pvt Ltd.

              1 Reply Last reply
              0
              • S Sonia Gupta

                how can i count the total items in the dropdownlist using the java script.

                Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

                A Offline
                A Offline
                Arif patel
                wrote on last edited by
                #7

                Hi Sonia, Looking at u r quarries I suggest you to visit this following site "www.javascripter.net" just navigate FAQ section of this site u will get solution for u r quarries. Regards, S.Arif patel

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups