Customized Listbox required

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • onlymukti4u
    New Member
    • Mar 2007
    • 50

    Customized Listbox required

    I just want to create a listbox . In which on select of one Item few items will display in a box having a tree like structure.Can anyone help me out?

    Or Can you help me out in making a listbox where it will show 5 items at a time and a vertical scrollbar, but the above box will be there. I mean if I am giving size attribute 5, it will show 5 items with scrollbar, but the above selectbox also I want.

    Regards,
    Prasad
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    I can't guide you the whole, but can show you a rough procedure.

    Create a div with position:absolu te; display:none, some specific height and width. Onclick of the select button (which ever should show the dropdown), turn style.display = ''.
    Inside the div, provide other divs (one div for each option). Leaving the first five option divs, make all the other option divs as display:none.
    After all the option divs, provide buttons (or hyperlinks) which'd say "show previous options" "show next options" or what ever is relevant. Onclick of those buttons, toggle the display of the options divs, to show next 5 (or previous 5) option divs.
    And most important, you need to manipulate the key press event in a way so that you can select an option with the movement keys.

    Comment

    • onlymukti4u
      New Member
      • Mar 2007
      • 50

      #3
      I had tried with that but one problem is that I cant move in the div with tabs or down arrows...

      Comment

      • onlymukti4u
        New Member
        • Mar 2007
        • 50

        #4
        So atleast can u guide me for the key press events..

        Comment

        • hsriat
          Recognized Expert Top Contributor
          • Jan 2008
          • 1653

          #5
          Originally posted by onlymukti4u
          I had tried with that but one problem is that I cant move in the div with tabs or down arrows...
          Did you utilize the onkeypress event?

          Comment

          • hsriat
            Recognized Expert Top Contributor
            • Jan 2008
            • 1653

            #6
            Originally posted by onlymukti4u
            So atleast can u guide me for the key press events..
            See this example.

            Comment

            • onlymukti4u
              New Member
              • Mar 2007
              • 50

              #7
              Thanks..It worked for me.

              Comment

              Working...