<%@ page language="java" contentType="test/html;charset=gb2312"%>
<%
int aa=0;
%>
<html>
<head>
<script>
function lbh(){
var tempValue="0";
if(document.form1.lbh.value=="2"){ //选种自动获取
    tempValue=documentl.form1.lbh.value;
   <%
   //做数据库记录查询
     ........
    aa="记录总数"+1;
    %>
     }
<% 
if(aa!=0){
 %>
    document.form1.show.value="<%=aa%>";
<%
     }
%>  
}
</script>
</head>
<body>
<form name="form1">
<select name="lbh" onChange="lbh()">
<option value="1">请选择</option>
<option value="2">自动获得id</option>
<option value="3">手动获得id</option>
</select>
<input type=text name="show">
</form>
</body>
</html>