Hello Every1,the issue is regarding how to retain the selected value in Combobox during pagination. "i have a combobox which has some values,whenevr i select 1 value then according to the value selected the Records per page will be defined BUT whenever i navigate to next page then the value in combobox gets reset to first value". Here's the piece of code..
For Combobox
print qq[<td>Records PerPage</td>];
print qq[<td><select id="combo1" onchange="getCombo1(this.options
[this.selectedIndex].value,$pageNum)"><option value="">Select</option><option
value="2">2</option><option value="4" >4</option><option
value="6">6</option><option value="10">10</option></select></td></tr>];
The Javascript
<script type="text/javascript">
function getCombo1(offset,pagenumber)
{
var val1=pagenumber;
var val2=offset;
window.location="UsersList.cgi?pageNum="+val1+"&offset="+val2
}
The Pagination Code
if ( $pageNum > 0 ) {
print qq[<tr><td><a href="UsersList.cgi?
pageNum=0&offset=$offset&SortBy=$SortBy&SortOrder=$SortOrder">|<</a></td>];
$pageN = $pageNum - 1;
print qq[<td><a href="UsersList.cgi?
pageNum=$pageN&offset=$offset&SortBy=$SortBy&SortOrder=$SortOrder"><</a></td>];
}
else
{
print q[<td><span class="currentpage">|<</span></td>];
print q[<td><span class="currentpage"><</span></td>];
}
if ( $pageNum < ( $numofPages - 1 )) {
$pageN = $pageNum + 1;
print qq[<td><a href="UsersList.cgi?
pageNum=$pageN&offset=$offset&SortBy=$SortBy&SortOrder=$SortOrder">></a>
</td>];
$tempnumpage=$numofPages-1;
print qq[<td><a href="UsersList.cgi?
pageNum=$tempnumpage&offset=$offset&SortBy=$SortBy&SortOrder=$SortOrder">>|
</a></td>];
}
else {
print q[<td><span class="currentpage">></span></td>];
print q[<td><span class="currentpage">>|</span></td>];
}
my $temppageNumber=$pageNum+1;
print qq[<td><b> $temppageNumber of $numofPages pages</b></td>];
Please Help Me find the solution.Thank You