1. 程式人生 > >得到複選框的值

得到複選框的值

     <select mice-select="select" id="complete">
	<option value="" >所有</option>
	<option value="0" <c:if test="${status==0}">selected</c:if> >已儲存</option>
	<option value="1" <c:if test="${status==1}">selected</c:if> >已傳送</option>
	<option value="2" <c:if test="${status==2}">selected</c:if> >已終結</option>
     </select> 
     <input id="status"  type="hidden" name="status"  value="${status}"/>
     <input type="button" mice-btn="icon-search" value="查詢" onclick="search();" />

   function search(){
       document.getElementById('status').value = $('#complete').val();
       document.getElementById('searchTasksForm').submit();
   }

通過隱藏域傳值