The code is as follows:
The code copy is as follows:
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
</head>
<body>
<form id="pquery" method="post" action="supplierAction!list.action">
<div>
Product Name:
<input name="bill.goodsname" type="text">
Whether to pay:
<select name="bill.pay">
<option value="">
Please select
</option>
<option value="01">
Payed
</option>
<option value="02">
Unpaid
</option>
</select>
<!--JS is invalid because the name of the button below is called submit-->
<input name="submit" value="combination query" type="submit">
</div>
<div style="text-align: center;">Display per page
<select name="page.pageItems" onchange="gotoSelectedPage1()">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="50">50</option>
</select>A total of 6 records
<input id="curpage" name="page.currentPage" style="height:14px;line-height:14px; vertical-align:middle;color:#005aa7; border-bottom:1px solid #005aa7;border-top:0px;border-left:0px;border-right:0px;background-color:transparent;width:14px;text-align: center; " readonly="readonly" value="1" size="3">
Page / Total 1 page <a href="javascript:page_first();">Page 1</a>
<a href="javascript:page_last();">Last page</a> Jump to:
<select id="selectpage" onchange="gotoSelectedPage()">
<option value="1" selected="selected">1</option></select></div>
<script type="text/javascript">
function sel(val){return document.getElementById(val);}
var page=sel('curpage');var form=sel('pquery');var select=sel('selectpage');
function page_first() {page.value = 1;form.submit();}
function page_pre() {var a = page.value;a = parseInt(a) - 1;page.value = a;page_validate();form.submit();}
function page_next() {var a = page.value;a = parseInt(a) + 1;page.value = a;page_validate();form.submit();}
function page_last() {page.value = 1;form.submit();}
function page_validate() {var a = page.value;if (a < 1){a = 1;} if (a > 1){a = 1;}page.value = a;}
function gotoSelectedPage1() {page.value = 1;form.submit();}
function gotoSelectedPage() {page.value = select.value;form.submit();}
</script>
</div>
</form>
</body></html>
After deleting the name attribute, it works normally~~What is the reason? After some research and consultation, a great master gave the answer
Elements in form are obtained through name. If name=submit, then form.submit should get the input. So form.submit() will report an error that is not a score
Have you understood, I hope this article can help you