给你个例子,不知是不是你想要的,你可以参考一下:
<html>
<head>
<title>显示设置</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function selectpage() {
if (form1.soft.value!="default") {
form1.action="/b2002/search2.asp" 
} else {
form1.action="front_main.asp?number=" + document.all.number.value
}
}
</script>
</head><body>
<table width=90% class=tab_m align=center><form name="form1" method="post" target="main">
  <tr> 
    <td align="center">每页显示<input type="text" name="number" value="20" size="2" onblur="if(this.value.match(/\d+/)!=this.value && this.value!='' || parseInt(this.value)==0){alert('必须填入正整数数字!');this.select();this.focus();}">条</td>
  </tr>
  <tr> 
    <td align="center"><input type="submit" value="确定" onclick="javascript:selectpage()"></td>
  </tr>
</form>
</table>
<br>
<center>[ <a href="javascript:window.close()">关闭窗口</a> ]</center>  
</body>
</html>