2017-02-14 79 views
0

驗證後,我有一種形式,如下下拉:不加載下拉列表上的頁面重載

enter image description here

我已經寫驗證警報作爲本上面的菜單等領域。但是,當任何驗證觸發的,這個下拉沒有被重新加載頁面後重新填充,並顯示如下:

enter image description here

我有以下我的jsp:

<tr><td> 
<stripes:checkbox name="policyShow" onclick="handleDisable(policyShow, policyNumber,null)"/><stripes:label for="DealerTransactionReport.policy" /></td> 
<td>     
<stripes:select name="policyNumber" disabled="${!actionBean.policyShow}" onchange="handleSelectedAll();"> 
<stripes:options-collection collection="${actionBean.policyList}" value="policyNumber" label="description" /> 
</stripes:select> 

</td> 
</tr> 

我試着寫一個onchange功能,但沒有到目前爲止工作,目前,我有下面的代碼:

function handleSelectedAll() 
{ 
     var select = document.forms['dealerTransactionForm'].policyNumber.options[document.forms['dealerTransactionForm'].policyNumber.selectedIndex].index; 
if(select== 0) 
{ 
document.forms[dealerTransactionForm].searchTxt.value="";   
} 

} 

可有人請建議我該如何解決ŧ他的問題?

回答

2

這是因爲您在回發期間丟失了數據。無論下拉列表中選定的值如何,您都需要在頁面加載期間獲取數據。請注意,只有選定的值被傳遞給服務器,而不是所有的選擇選項。

相關問題