大哥们帮帮小弟,谢谢!

lovewangshuqiong 2006-10-21 04:57:39
<form id="form1" name="form1" method="post" action="tijiao.asp">
<p> </p>
<p>用户名:</p>
<p>
<input type="text" name="username" />
</p>
<p>密码:</p>
<p>
<input type="password" name="password" />
</p>
<p>联系电话:</p>
<p>
<input type="text" name="telephone" />
</p>
<p>e-mail:</p>
<p>
<input type="text" name="mail" />
</p>
<p>
<input name="zhuce" type="button" id="zhuce" value="注册" />


</p>


<input type="button" name="xiugai " value="删除数据" />
上述表单中 我要写一个单击"注册"这个按钮提交"form1"
单击"删除数据"就删除用户之前已填好的数据 的效果的javascript代码该怎么写?

再次谢过各位大哥
...全文
163 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
什么都不能 2006-10-22
  • 打赏
  • 举报
回复
<form id="form1" name="form1" method="post" action="tijiao.asp">
<p> </p>
<p>用户名:</p>
<p>
<input type="text" name="username" />
</p>
<p>密码:</p>
<p>
<input type="password" name="password" />
</p>
<p>联系电话:</p>
<p>
<input type="text" name="telephone" />
</p>
<p>e-mail:</p>
<p>
<input type="text" name="mail" />
</p>
<p>
<input name="submit" type="button" id="zhuce" value="注册" />
</p>
<p><input type="reset" value=" 重置 " />
</form>
================
处理数据
.asp
--------------
<%
dim username,password,telephone,mail
private sub getData
username=trim(request.form("username"))
password=trim(request.form("password"))
phone=trim(request.form("telephone"))
mail=trim(request.form("mail"))
end sub
private sub insert
set db=new DataBase
db.insert("insert into dbo.[table] (username,password,telephone,mail) values ('"&username&"','"&md5(md5(password))&"','"&phone&"','"&mail&"')")
if db.Err=0 then
msg "注册成功","login.htm"
response.end
else
msg "注册失败","register.htm"
response.end
end if
%>
<%
class Database
public conn
private sError
private sub class_initialize
On Error Resume Next
set conn=server.createObject("adodb.connection")
conn.open ....
if Err or (not isobject(conn)) then
response.write "Error:Can't open database,please contact the administrator."
Err.clear
response.end
end if
end sub

public property get Error
Error=sError
end property

public sub insert(sSQL)
On Error Resume Next
conn.execute(sSQL)
sError=Err
end sub

public function delete(sSQL)
if sSQL="" then response.end
on error resume next
conn.execute(sSQL)
if err then
Query=false
else
Query=true
end function
'.....
private sub class_terminate
if isObject(conn) then
conn.close
set conn=nothing
end if
end sub
end class
%>
lovewangshuqiong 2006-10-22
  • 打赏
  • 举报
回复
叩头感谢各位大哥了!
myvicy 2006-10-21
  • 打赏
  • 举报
回复
如果你是要删除该条记录的话。
<form id="form1" name="form1" method="post" action="tijiao.asp">
<p> </p>
<p>用户名:</p>
<p>
<input type="text" name="username" />
</p>
<p>密码:</p>
<p>
<input type="password" name="password" />
</p>
<p>联系电话:</p>
<p>
<input type="text" name="telephone" />
</p>
<p>e-mail:</p>
<p>
<input type="text" name="mail" />
</p>
<p>
<input name="zhuce" type="submit" name="deal" value="注册" />

</p>

<input type="submit" name="deal" value="删除数据" />
</form>
然后在tijiao.asp里
<%
if request("deal")="注册" then
'执行注册代码
elseif request("")="删除数据" then
'执行删除代码
end if
%>
lbsfans 2006-10-21
  • 打赏
  • 举报
回复
<input type=reset id="xiugai" value="删除数据" />
lovewangshuqiong 2006-10-21
  • 打赏
  • 举报
回复
是不是这样写啊? <input type=submit id="zhuce" onclik="form1_submit();>
<input type=reset id="xiugai" onclic=form1data_delete();>
           我是个菜鸟,请大哥们不要见笑,再次谢过!
myvicy 2006-10-21
  • 打赏
  • 举报
回复
<form id="form1" name="form1" method="post" action="tijiao.asp">
<p> </p>
<p>用户名:</p>
<p>
<input type="text" name="username" />
</p>
<p>密码:</p>
<p>
<input type="password" name="password" />
</p>
<p>联系电话:</p>
<p>
<input type="text" name="telephone" />
</p>
<p>e-mail:</p>
<p>
<input type="text" name="mail" />
</p>
<p>
<input name="zhuce" type="submit" id="zhuce" value="注册" />


</p>


<input type="reset" name="xiugai " value="删除数据" />
</form>

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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