嗨,我使用的PHP,我使用的是Ajax我从数据库中检索数据,无需重新加载页面我现在正在同一页面上获取数据我希望当我得到的数据我以表格格式检索那么当我点击时有更新按钮在更新按钮的新形式应打开如何在点击按钮中打开新表单?
这里是代码
的index.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function fun()
{
var exam=new XMLHttpRequest();
exam.onreadystatechange=function()
{
if(exam.readyState==4)
{
document.getElementById("res").innerHTML=exam.responseText;
}
}
exam.open("GET","rat_test.php?name=pramod",true);
exam.send(null);
}
</script>
</head>
<body>
<form action="" method="post" id="form" name="form">
<table>
<tr>
<td></td><td><input type="button" onclick="fun();" value="getvalue" />
</td></tr>
<div id="res"></div>
</table>
</form>
</body>
</html>
rat_test.php
<table border="1">
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
</tr>
<?php
include("connection.php");
$sel="select * from info";
$res=mysql_query($sel);
while($fet=mysql_fetch_array($res))
{ ?>
<tr>
<td><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" ></td>
<td><?php echo $fet['id']; ?></td>
<td><?php echo $fet['name']; ?></td>
</tr>
<?php }
?>
</table>
<form action="" method="post" id="form" name="form">
<table>
<tr>
<td></td><td><input type="button" onclick="fun()1;" value="Update" />
</td></tr>
</table>
</form>
在这里test_rat.php一个更新按钮可我想打开一个新的窗体上更新按钮按钮
我怎样才能做到这一点
任何帮助将不胜感激
要么得到使用Ajax的新的形式或者用JavaScript的飞行 – Shadow 2014-09-04 06:12:38
创建我怎么能拿ü可以请写一些代码 – 2014-09-04 06:13:37