我用JavaScript的window.open实现了一用户查询窗口,当我点击弹出窗口的“执行查询”按钮时,应该执行查询数据库的操作,并同时将查询结果显示在主页面Datagrid控件上。请各位大使指教,应该怎么写这段JavaScript程序。
代码如下:
请问各位这个JavaScript的execSearch()函数该怎么写。
调用窗口页面代码如下:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function execSearch(){}
function closeit() { setTimeout("self.close()",10000) //毫秒 }
//-->
</script>
</head>
<body onload="closeit()">
<div align="center">
<form name="form1">
<table width="60%" border="0">
<tr>
<td colspan="2"> <div align="center"><strong>用户信息查询</strong></div></td>
</tr>
<tr>
<td width="36%"><div align="left">姓名:</div></td>
<td width="64%"> <div align="left">
<input type="text" name="name">
</div></td>
</tr>
<tr>
<td><div align="left">身份证:</div></td>
<td> <div align="left">
<input type="text" name="shenfengzheng">
</div></td>
</tr>
<tr>
<td><div align="left">地址:</div></td>
<td> <div align="left">
<input type="text" name="address">
</div></td>
</tr>
</table>
<table width="60%" border="0">
<tr>
<td width="51%" align="right"><input type="button" value="执行查询" onclick="execSearch()" > </td>
<td width="49%" ><input type="button" name="close" value="关闭" onclick="window.close()"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
代码如下:
请问各位这个JavaScript的execSearch()函数该怎么写。
调用窗口页面代码如下:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function execSearch(){}
function closeit() { setTimeout("self.close()",10000) //毫秒 }
//-->
</script>
</head>
<body onload="closeit()">
<div align="center">
<form name="form1">
<table width="60%" border="0">
<tr>
<td colspan="2"> <div align="center"><strong>用户信息查询</strong></div></td>
</tr>
<tr>
<td width="36%"><div align="left">姓名:</div></td>
<td width="64%"> <div align="left">
<input type="text" name="name">
</div></td>
</tr>
<tr>
<td><div align="left">身份证:</div></td>
<td> <div align="left">
<input type="text" name="shenfengzheng">
</div></td>
</tr>
<tr>
<td><div align="left">地址:</div></td>
<td> <div align="left">
<input type="text" name="address">
</div></td>
</tr>
</table>
<table width="60%" border="0">
<tr>
<td width="51%" align="right"><input type="button" value="执行查询" onclick="execSearch()" > </td>
<td width="49%" ><input type="button" name="close" value="关闭" onclick="window.close()"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货