Drop Down Box not working in JSP

Go To StackoverFlow.com

0

Making a drop down list for my JSP and the values I'm entering won't show. Probably me being an idiot but a solution would be really helpful

The drop down box appears but the values to select are empty.

It's a big JSP so here's the piece that I'm looking at..

Form is put at the top of the JSP:

out.println("<form action=\"ExchangeServlet\" method=\"get\">");                    

At the bottom of the jsp:

out.println("<select name =\"status\">"+
"option value =\"Accepted\">Accepted</option>"+
"option value =\"Declined\">Declined</option>"+
"</select>");
out.println("<br />");
out.println("<input type=\"submit\" value=\"Update Exchange\" />");
out.println("</form>");
2012-04-04 19:27
by Jimmy
Perhaps using valid HTML for those options - Brian Roach 2012-04-04 19:30


4

Your HTML is invalid.

Change

out.println("<select name =\"status\">"+
"option value =\"Accepted\">Accepted</option>"+
"option value =\"Declined\">Declined</option>"+
"</select>");

to

out.println("<select name =\"status\">"+
"<option value =\"Accepted\">Accepted</option>"+
"<option value =\"Declined\">Declined</option>"+
"</select>");
2012-04-04 19:32
by Chris Thompson
haha knew I was being a retard. Been staring at my code far too long now. - Jimmy 2012-04-04 19:37
@Jimmy, definitely happens to all of us - Chris Thompson 2012-04-04 19:53
Ads