asp查询代码或PHP查询代码都行
- 提问者网友:孤凫
- 2021-04-27 04:36
- 五星知识达人网友:長槍戰八方
- 2021-04-27 05:50
在页面加载时可以将style设置为none,也就是隐藏
<script language="javascript">
function showtb()
{
document.getElementById('tb').style.display = 'block';
}
onload = function() {
document.getElementById('tb').style.display = 'none';
}
</script>
<input type="text" id="txt" />
<input type="button" name="btn" value="提交" onclick="showtb()" />
<table id=tb border=1>
<tr><td>123123
<tr><td>45646
</table>
补充:PHP服务端实现,原来你要先POST到服务器然后再输出来啊
<form method="POST" action="<?=$_SERVER['PHP_SELF']?>">
<input type="text" name="txt" />
<input type="hidden" name ="postclick" value="true" />
<input type="submit" value="提交" />
</form>
<div id="tbdiv">
<?php
if ( $_POST['postclick'] == "true" ) {
echo "<table border=1 style='width:100%'>";
echo "<tr><td>数据<tr><td>".$_POST['txt'];
echo "</table>";
}
?>
</div>
ASP页面实现:
<form method="POST" action="<%=Request.ServerVariables("URL")%>">
<input type="text" name="txt" />
<input type="hidden" name ="postclick" value="true" />
<input type="submit" value="提交" />
</form>
<div id="tbdiv">
<%
If Request("postclick") = "true" Then
Response.Write "<table border=1 style='width:100%'>"
Response.Write "<tr><td>数据<tr><td>" & Request("txt")
Response.Write "</table>"
End If
%>
</div>
你要的是不是这个效果?
- 1楼网友:你可爱的野爹
- 2021-04-27 08:54
- 2楼网友:低音帝王
- 2021-04-27 07:41
- 3楼网友:逃夭
- 2021-04-27 06:50
给一个完整的ASP代码你 刚刚写的 测试通过
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml"> <head runat="server"> <title>无标题页</title> <script language="javascript" type="text/javascript"> function quanquan() { document.getElementById('qq').innerHTML="<table style='width:100%;'border='1'><tr><td>数据</td></tr><tr><td>"+document.getElementById("Text1").value+"</td></tr></table>"; } </script> </head> <body> <form id="form1" runat="server"> <div> <input id="Text1" type="text" /> <input id="Button1" type="button" value="提交" onclick="quanquan()"/><br /> <br /> <span id="qq"></span> <br /> </div> </form> <p> </p> </body> </html>
PHP的跟这个也类似 最主要的是JS代码这一块
希望对您有帮助
谢谢!!