两个挺实用的小功能:
1.回车提交表单:重要的是里面传递的event变量!!
1
<INPUT TYPE=text NAME="button" SIZE=20 maxlength = 8 onkeydown="KeyDown(event);">
2
3
4
<script language="javascript">
5
function KeyDown(event)
6
{
7
if (event.keyCode == 13)
8
{
9
event.returnValue=false;
10
event.cancel = true;
11
Form1.btnsubmit.click();
12
}
13
}
14
</script>

2

3

4

5

6

7

8

9

10

11

12

13

14

2.在TextArea中按Ctrl+回车提交表单
1
<script language="JavaScript">
2
function KeyDown(){
3
if(!(event.shiftKey||event.altKey)&&event.keyCode==13&&event.ctrlKey){
4
document.GroupSendForm.submit();
5
}
6
}
7
</script>
8
<form name="GroupSendForm" method="post">
9
<textarea name="OtherPhone" rows="15" onKeyDown="return KeyDown();"></textarea>
10
<input type="submit" name="Submit" value="提交">
11
</form>

2

3

4

5

6

7

8

9

10

11
