0

I have a list of records displayed on a JSP page. The user then can click an 'edit' link to modify any part of those records. when they click the edit link they are taken to a different JSP page that has all of the input fields for the record (name, rating, price, etc). the problem is that one of the fields is a select option menu. How can i dynamically set this select menu to the correct option? its easy for the text fields because its just

  value="<%=title%>"

but idk what to do for the option menu. help?

4

1 に答える 1

1

渡されたデータをそのページのデータ セットと比較する必要があります。

このようなことをしてください

ループを実行します。小切手

if(passedValue==thisValue)
   <option selected=\"selected\"><%=your value%></option> 
else
   <option><%=your value%></option> 
于 2012-04-10T03:44:09.837 に答える