下面的代码应该怎么修改才能实现上一页、下一页、首页功能,为什么每次都是传到首页?
<script language="javascript">
function go(num){
document.getElementById("cp").value = num;
document.spform.submit();
}
</script>
<form name="spform" action="<%=URL%>" method="post">
<input type="button" value="首页" onclick="go(1)">
<input type="button" value="上一页" onclick="go(<%=currentPage-1%>)">
<input type="button" value="下一页" onclick="go(<%=currentPage+1%>)">
<input type="button" value="尾页">
<input type="hidden" id="cp" value="1">
</form>