1. 程式人生 > >jsp頁面重新整理後保留文字輸入框和下拉框的值

jsp頁面重新整理後保留文字輸入框和下拉框的值

保留下拉框

<select name="status">
    <option value="all" <c:if test="${status eq 'all'}">selected</c:if>>狀態</option>
    <option value="notstart" <c:if test="${status == 'notstart'}">selected</c:if>>未開始</option>
    <option value="running" <c:if test="${status eq 'running'}">selected</c:if>>進行中</option>
    <option value="end" <c:if test="${status eq 'end'}">selected</c:if>>已結束</option>
   </select>

保留文字框輸入值

特價活動名稱:<input type="text" name="sname" value="${sname}"/> &nbsp;&nbsp;&nbsp;