在WEB页面上输入跳转页码

来源:互联网 发布:游戏编程需要学什么 编辑:程序博客网 时间:2024/05/22 14:43

       用showreport.jsp去展现报表页面时,对于分页且页数比较多的报表,会在报表上方以上一页、下一页方式来展现,但对于有几百页的报表,这种调整方式显然不灵活,所以我们可以在JSP页面上做些修改,可以通过手工输入页码的方式跳转到指定页面。

制作方法:

1、制作跳转按钮

<%

String tpagestr = "<input type=\"text\" style=\"width:30px;\" value=\"\" name=\"atpage\" id=\"atpage\"><input type=\"submit\" value=\"跳转\" onclick=\"aa();\">";

%>

2、加入一段JavaScript代码,获取页号。

<script type="text/javascript">

function aa(){

var pagenum = document.getElementById("atpage").value;

try{report1_toPage(pagenum);

}

catch(e){}

return false;}

</script>

效果图: