Menu

Can't get the first item from drop down list

kitty
2005-02-19
2013-04-26
  • kitty

    kitty - 2005-02-19

    Hi,

    I've used the "getOptions" and "getOptionValues" to get the options from drop down list. Well, I can get the values for all options from the list, but I can't get all the options from the list, it always miss the first one like the following :

    option :                                value : 10
    option : TEST_Groups_NAME     value : 1
    option : TEST_Groups_NAME_1   value 2

    and my select lists in the html is :

    <SELECT NAME="GroupID" class="drpdwn" style="WIDTH: 150px" width="150" >
    <OPTION VALUE="10">Not configured</OPTION>
    <OPTION VALUE="1"  SELECTED>TEST_Groups_NAME</OPTION>
    <OPTION VALUE="2">TEST_Groups_NAME_1</OPTION>
    </SELECT>

    does anybody knows?

    Kitty

     
    • Kathy Feller

      Kathy Feller - 2005-03-04

      There must be something different about the page that you're not posting.  I tried to duplicate the form, but it works for me.

      Here's the code I used.  I put the webpage on an accessible site so you could look at it.

              WebConversation wc = new WebConversation();

              // Process main page
              WebResponse response = wc.getResponse("http://www.elbardic.com/test/formOptions.html");

              WebForm form = response.getFormWithName("test");
              String[] options = form.getOptions("GroupID");
              System.out.println("Options =");
              for (int i = 0; i < options.length; i++)
                  System.out.println(options[i]);
              String[] optionValues = form.getOptionValues("GroupID");
              System.out.println("OptionValues =");
              for (int i = 0; i < optionValues.length; i++)
                  System.out.println(optionValues[i]);

      kathy

       
      • kitty

        kitty - 2005-03-07

        I will try and see if it works for 1.5.4, if it does that's will make my life more easier. Thanks for the help.

         

Log in to post a comment.

Auth0 Logo