由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
BuildingWeb版 - 如何写focus button
相关主题
How to get button name?Help! how to design a submit button in a form?
question about ASPopen new window by javascript?
Help on javascript of Netscape on Mac另一个小问题...
问一个HTML 表格Radio button 和text field 共用的问题如何把ASP的变量传到javascript/HTML的参数
A question about onblur and onclickplease help, java event handlers
How to open a Windows Application (*.exe file) using a button in Flash?[转载] 怎么用onClick检查有效性,通过了再link向新的页面
吐槽 MySQLA simple jump box question (JS)
a question about photoshopHTML/JSP/Javascript问题求教
相关话题的讨论汇总
话题: button话题: default话题: enter话题: form话题: method
进入BuildingWeb版参与讨论
1 (共1页)
s*****p
发帖数: 5342
1
页面上有数个button.怎么能让default在某个button上,so that when user hits
return key, it goes with that default button?
先谢了!
r****y
发帖数: 26819
2
用form和submit啊

【在 s*****p 的大作中提到】
: 页面上有数个button.怎么能让default在某个button上,so that when user hits
: return key, it goes with that default button?
: 先谢了!

s*****p
发帖数: 5342
3
i use

【在 r****y 的大作中提到】
: 用form和submit啊
r****y
发帖数: 26819
4
这个没有default的东西啊

【在 s*****p 的大作中提到】
: i use
s*****p
发帖数: 5342
5
是这样的, it is like if user clicks that button, it works fine. However, if user hits "Enter" key
on keyboard directly, it has error. it seems it goes with that action but
without method information. I wonder if i could default to that button.

【在 r****y 的大作中提到】
: 这个没有default的东西啊
o***s
发帖数: 31
6
Enter key defaults to 当前form(指有focus field)的第一个submit button.
t*******d
发帖数: 1530
7
问题出在onclick。
Enter will submit the form and totally ignore onclick event, since no mouse
click happens on that button.
You will need to define your method in onsubmit function for that form, this
way no matter how the form is submitted(enter or click), the onsubmit
function will fire.
btw, if you want the default action to include the "method=load".... why not
simply change the default action for the form?

."
key

【在 s*****p 的大作中提到】
: 是这样的, it is like : if user clicks that button, it works fine. However, if user hits "Enter" key
: on keyboard directly, it has error. it seems it goes with that action but
: without method information. I wonder if i could default to that button.

1 (共1页)
进入BuildingWeb版参与讨论
相关主题
HTML/JSP/Javascript问题求教A question about onblur and onclick
请教一个onclick的问题How to open a Windows Application (*.exe file) using a button in Flash?
how to do this?吐槽 MySQL
unlink the current menu itema question about photoshop
How to get button name?Help! how to design a submit button in a form?
question about ASPopen new window by javascript?
Help on javascript of Netscape on Mac另一个小问题...
问一个HTML 表格Radio button 和text field 共用的问题如何把ASP的变量传到javascript/HTML的参数
相关话题的讨论汇总
话题: button话题: default话题: enter话题: form话题: method