Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

this is my code, here i want the textboxvalue to be populated in dropdown list and make a directory of that name.
HTML
<tr>
    <td>
        Add to Album
    </td>
    <td>
        <input type="text" name="Album"/>

    </td>
</tr>
<tr>
    <td></td>
    <td> <input type="submit" value="addalbum" /></td>
</tr>
  <tr>
    <td>
        Select Album
    </td>
    <td>
        <%

            String webTempPath = "C:\\Users\\Documents\\NetBeansProjects\\Registrationform\\web\\nameoffolder"+ "\\" + (session.getAttribute("uname"));
            String path = webTempPath.toString();
            File file = new File(webTempPath);
            String[] names = file.list();
            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>");
         %>

    </td>
</tr>
Posted
Updated 22-Oct-15 20:27pm
v2
Comments
Member 12003699 27-Oct-15 9:49am    
You will need a value in your option tag first.

"<option value=" + name + ">"

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