Hi,
I have a jsp page that a user can access to edit a row in a database. One of the items on the form is a Select Box where a user can select more then 1 item from a drop down list of 15 items. The form works fine with regards to capturing the users choices and updating the database. The problem is that if the user goes back to the form to edit another field the multiple select box shows nothing as highlighted and thus wipes out all previous selections. How can I get multiple selections to be highlighted? I can and have done it with single selections but I can’t seem to get multiple selections to work. ? Can anyone out there point me in the right direction???
Thanks for any and all suggestions.
[CODE]
out.println(“<tr><td class=”formfieldicons”><td class=”formfieldlabel”>Add’l Program:</td><td class=”formfieldvalue”><select multiple size=’2′ name=”newpgms”>”);
for (int i = 0; i < pgmList.size(); i++) {
String pgms = pgmList.get(i).toString();
int start = pgms.indexOf(quote);
int end = pgms.indexOf(quote, start + 1);
if (s_pgms.equals(pgms.substring(start+1, end) + “,”)) {
pgms = pgms.substring(0, end+1) + ” SELECTED ” + pgms.substring(end+1);
}
out.println(pgms);
}
out.println(“</select></td></tr>”);