日期:2014-05-17  浏览次数:21002 次

我做好了分页,假若有4页的话,我想通过下拉框中选择数字4即可快速定位到第4页??
假若查询到的记录共有4页,那么我想通过下拉框选择第4页快速定位..
此时下拉列表框也只有1,2,3,4共四个选项

也就是,如果查询记录有N页,那么下拉列表框中就有从1到N个数字选项,选择任意页次M(1 <=M <=N),快速定位到M页..

我以前看到有好多,怎么做的??

------解决方案--------------------
<script type= "text/JavaScript ">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+ ".location= ' "+selObj.options[selObj.selectedIndex].value+ " ' ");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

<form name= "form1 " id= "form1 ">
<select name= "menu1 " onchange= "MM_jumpMenu( 'parent ',this,0) ">
<option value= " "> unnamed1 </option>
</select>
</form>
------解决方案--------------------
<select name= "select " onChange= "JavaScript:window.location.href= '?Page= '+this[this.selectedIndex].value; ">
<option value= "1 "> 1 </option>
<option value= "2 "> 2 </option>
<option value= "3 "> 3 </option>
<option value= "4 "> 4 </option>
</select>