0
我有一個下拉值列表,用戶將從這個下拉列表中選擇一個值。如何將javascript變量值分配給jsp標籤屬性?
<strong>SelectPageCount: </strong>
<select id="pageCount" onChange = "setPageSizeValue();">
<option value="50">50</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
<option value="250">250</option>
<option value="500">500</option>
</select>
我已經在這個javascript函數得到下拉列表中的值。
function setPageSizeValue()
{
var dropDownDocument = document.getElementById("pageCount");
var displayElementDocument = document.getElementById("displayTable");
var pagesize = dropDownDocument.options[dropDownDocument.selectedIndex].value;
displayElementDocument.setAttribute('pagesize', dropDownDocument.options[dropDownDocument.selectedIndex].value);
alert(pagesize);
}*
ALTER快到正常顯示,我們在下拉列表中設置的值。
這是我們的JSP
在這個JSP頁面大小中的屬性我想分配頁面大小varialbe的JavaScript中所做的值。
<display:table id="displayTable" name="ewCandidateList" sort="list" pagesize="<%=size %>" requestURI="CandidateSearchResult"
decorator="com.thomsonreuters.legal.lem.lpa.ui.decorator.EWCandidateSearchResultDecorator"/>