1. 程式人生 > >下拉框select使用

下拉框select使用

返回資料被選中

  <select name="orderstate" >

                  <option value="1" <c:if test="${order.orderstate==1 }"> selected="selected"</c:if>>待確認</option>


                  <option value="2" <c:if test="${order.orderstate==2 }"> selected="selected"</c:if>>待付款</option
> <option value="3" <c:if test="${order.orderstate==3 }"> selected="selected"</c:if>>待發貨</option> <option value="4" <c:if test="${order.orderstate==4 }"> selected="selected"</c:if>>待收貨</option> <option
value="5" <c:if test="${order.orderstate==5 }"> selected="selected"</c:if>>待評價</option> <option value="6" <c:if test="${order.orderstate==6 }"> selected="selected"</c:if>>已完成</option> <option value="7" <c:if test="${order.orderstate==7 }"
> selected="selected"</c:if>>交易關閉</option> </select>

form表單

 <select name="order.orderstate" style="width: 75px;height: 34px;">
                          <option selected="selected" value="1">待確認</option>
                           <option value="2">待付款</option>
                            <option value="3">待發貨</option>
                             <option value="4">待收貨</option>
                              <option value="5">待評價</option>
                               <option value="6">已完成</option>
                                <option value="7">交易關閉</option>


                       </select>