请帮忙改改代码。。。

wxr9999 2003-08-22 09:09:38
如何提交内容后再使光标回到内容表单中??请修改一下下面代码.

<style type="text/css">
<!--
table {
font-family: "宋体";
font-size: 12px;
text-decoration: none;
}
-->
</style>
<script Language="JavaScript">
function bs()
{
document.forms.form1.text3.focus();
}
</script>
<%if request("act")="b" then%>

<!--#include file="conn.asp"-->
<%
sql="select * from show"
rs.open sql,conn,3,2
rs.addnew
rs("show")=Request.Form("text")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect "type.asp"
Response.End()
%>
<%else%>
<body leftmargin="0" topmargin="0">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="1" bgcolor="#333399"></td>
</tr>
<tr>
<td height="15"></td>
</tr>
</table>
<table width="642" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" method="post" action="type.asp?act=b">
<tr>
<td width="46">内容:</td>
<td width="518"><input name="text" type="text" id="text3" size="70"></td>
<td width="78" align="center">
<input type="submit" name="Submit" value=" 发 送 " onclick="bs();">
</td>
</tr>
</form>
</table>
<%end if%>
...全文
44 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lions911 2003-08-22
  • 打赏
  • 举报
回复
<input type="submit" name="Submit" value=" 发 送 " onclick="bs();">


这种用法错误,应该是去掉ONCLICK,然后:

<form name="form1" method="post" action="type.asp?act=b" onsubmit="javascript:bs()">
yannan_liv 2003-08-22
  • 打赏
  • 举报
回复
<body leftmargin="0" topmargin="0">改为<body leftmargin="0" topmargin="0" onload="bs();">

<input type="submit" name="Submit" value=" 发 送 " onclick="bs();">改为<input type="submit" name="Submit" value=" 发 送 ">
phoenix8122 2003-08-22
  • 打赏
  • 举报
回复
chinesun 2003-08-22
  • 打赏
  • 举报
回复
<script Language="JavaScript">
function bs()
{
document.forms.form1.text3.focus();
}
</script>
中间加入一行:
<script Language="JavaScript">
function bs()
{
document.forms.form1.text3.focus();
}
bs() //*********这一行就行了。你试试
</script>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧