HTML ListBox issues

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PrivateJoker
    New Member
    • Jul 2008
    • 4

    HTML ListBox issues

    I have a HTML list box created and I am trying to access the selected values on the PostBack. However I am only getting one value back from the list box.

    <TD ID='TDDescripti on'>
    <SELECT NAME='Descripti on' Class='RegText' isrequired=Yes Multiple=True Size=6 divname='Non-FatalCorrected' >
    <OPTION Value='aa' >aa</OPTION>
    <OPTION Value='bb' >bb</OPTION>
    <OPTION Value='cc' >cc</OPTION>
    <OPTION Value='dd' >dd</OPTION>
    <OPTION Value='ee' >ee</OPTION>
    </SELECT> </TD></TR></Table></Div></td>

    In the code behind I have:
    Dim aString As String = Request.Form("D escription")

    I expected to get the results back as "aa,bb,cc,dd,ee " if all the results were selected. However I am only getting back "aa".

    Any ideas?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Have you cycled through everything in the Request.Form collection to see what all you are getting?

    Comment

    • kunal pawar
      Contributor
      • Oct 2007
      • 297

      #3
      I suppose

      u have to give id attribute to HTML list box and then check ur form method is post or Get

      Another thing try using Request("Descri ption") it will give both value from Querystring and form

      Comment

      • PrivateJoker
        New Member
        • Jul 2008
        • 4

        #4
        I have tried all of the suggestions.

        Actually I was able to pin it down to the "divname" statement.

        EVERYTHING works in IE6, but it does not work in IE7.

        In IE7 if I remove the "divname" tag then the multiple selection works. However I need the divname for my javascript validation.

        Any suggestions?

        Comment

        • PrivateJoker
          New Member
          • Jul 2008
          • 4

          #5
          Originally posted by Plater
          Have you cycled through everything in the Request.Form collection to see what all you are getting?

          Yes. Only one entry (the first selection on the list) shows.


          I also tried using a standard HTML attribute such as "lang" and "title", but no matter what it still only returns one selection.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            What is the "divname" attribute? I don't think I've ever heard of it before?

            Comment

            • PrivateJoker
              New Member
              • Jul 2008
              • 4

              #7
              It was a custom attribute that they used to store information in.

              What I did was change divname to lang and hid the information in it.

              It seems to be working now.

              Thanks all for all your help.

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                I was going to say, IE doesn't like to handle incorrect markup. Combine that with incorrect DocTypes and things get a little funny.

                Comment

                Working...