Click here to Skip to main content
15,886,774 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here i want the dropdown's selected text. i tried using this but it just gets null value.
String [] drpdownvalue = request.getParameterValues("drplistalbum");

and i have made a dropdown like this

XML
out.println("<select name=\"drplistalbum\">");
                          for(String name : names)
                          {
                              if (new File(webTempPath + '\\' + name).isDirectory())
                              {

                                  out.println("<option>");
                                  out.println(name);
                                  out.println("</option>");

                              }
                          }
                           out.println("</select>");
Posted

1 solution

The tag <option> must have a value, example
HTML
<select name="drplistalbum">
   <option value="1">Option1</option>
   <option value="2">Option2</option>
   <option value="3">Option3</option>
</select>
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900