两个超简单问题,在线等...

starytx 2005-11-14 09:48:32
1:怎样让“提交”按钮相应回车键?我的提交按钮不知咋的不相应回车键了,按下回车后没反应(没有提交表单),得用tab键把焦点定位到按钮上才行,按钮的type=button,
2:怎样让select表单控件可编辑,即:可以输入值。
...全文
164 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
lisoon 2005-11-14
  • 打赏
  • 举报
回复
1.用window.event.keyCode==13取得回车,然后提交.
2.去javascript搜索,梅花雪的combox.
starytx 2005-11-14
  • 打赏
  • 举报
回复
up
starytx 2005-11-14
  • 打赏
  • 举报
回复
刚才查了一下资料,原来下拉框要可编辑不是改个什么属性就可以的,还得自己写东西来虚拟,这个控件设计的也忒差劲了!
starytx 2005-11-14
  • 打赏
  • 举报
回复
<script language="vbScript">
<!--验证输入是否合法
sub yanzheng(usercodestr)
dim theform
set theform=document.form1
if trim(theform.username.value)="" then
alert("请输入您的用户名!")
theform.username.focus()
theform.username.value=""
elseif instr(trim(theform.username.value),"'")>0 then
alert("用户名中不能包含单引号'!请重新输入.")
theform.username.focus()
theform.username.value=""
elseif theform.password.value="" then
alert("请输入您的密码!")
theform.password.focus()
elseif instr(theform.password.value,"'")>0 then
alert("密码中不能包含单引号'!请重新输入.")
theform.password.focus()
theform.password.value=""
elseif theform.yzm.value="" then
alert("请输入验证码!")
theform.yzm.focus()
elseif ucase(theform.yzm.value)<>ucase(usercodestr) then
alert("您输入的验证码不正确!请重新输入.")
theform.yzm.focus()
theform.yzm.value=""
else
theform.submit()
end if
end sub
-->
</script>
<form name="form1" method="post" action="sys_login.asp">

<tr>
<td height="26" colspan="3" align="center" valign="top"> <input type="button" name="login" value="登录"

onClick="yanzheng(<%=session("verifycode")%>)">

</td>
</tr>
</form>
hcz0663 2005-11-14
  • 打赏
  • 举报
回复
1、你是不是有两个表单元素,或者你程序中有那个按钮设了快捷键为Enter;
2、这样的功能你得自己写一个模拟程序,这样的程序网上很多,自己找找。
龙宜坡 2005-11-14
  • 打赏
  • 举报
回复
把代码萜贴出来看看!
starytx 2005-11-14
  • 打赏
  • 举报
回复
多谢多谢!第二个问题不找了,我在网上找了一个比较简单的实现方法。谢谢大家,结贴
lisoon 2005-11-14
  • 打赏
  • 举报
回复
1.
function sendform() {
if (event.keyCode==13)
document.yourform.submit();
}
document.onkeydown=sendform;
2.不好意思,写错了,应该是combobox,搜索"可编辑下拉列表框"也会有的。
starytx 2005-11-14
  • 打赏
  • 举报
回复
第一个问题 lisoon的回答应该可以的
---------------------
关键是我不知道怎么使用
mu_mu_wu 2005-11-14
  • 打赏
  • 举报
回复
up
morningling 2005-11-14
  • 打赏
  • 举报
回复
第一个问题 lisoon的回答应该可以的

第二个是要自己编写个类或者,虚拟一个,建议你可以用层+文本框+按钮和一起来做,就是比较烦一点,我曾今做过一个
starytx 2005-11-14
  • 打赏
  • 举报
回复
lisoon((水翡草芥--突然想去扫街)),您说的第一个方法怎么使用?麻烦指点一下;在javascript中用combox关键字没搜到什么东西呀。
zly22169846 2005-11-14
  • 打赏
  • 举报
回复
理解错误楼主的意思了.
sorry
zly22169846 2005-11-14
  • 打赏
  • 举报
回复
第一个问题这样就ok了.
<input type="submit" value="确定" onClick="window.location.href='http://163.com'" >

第二个问题帮你顶下
lnboy1003 2005-11-14
  • 打赏
  • 举报
回复
ding

28,405

社区成员

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

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