<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<script type="text/javascript">
function isKeyTrigger(e,keyCode){
var argv = isKeyTrigger.arguments;
var argc = isKeyTrigger.arguments.length;
var bCtrl = false;
if(argc > 2){
bCtrl = argv[2];
}
var bAlt = false;
if(argc > 3){
bAlt = argv[3];
}
var nav4 = window.Event ? true : false;
if(typeof e == 'undefined') {
e = event;
}
if( bCtrl &&
!((typeof e.ctrlKey != 'undefined') ?
e.ctrlKey : e.modifiers & Event.CONTROL_MASK > 0)){
return false;
}
if( bAlt &&
!((typeof e.altKey != 'undefined') ?
e.altKey : e.modifiers & Event.ALT_MASK > 0)){
return false;
}
var whichCode = 0;
if (nav4) whichCode = e.which;
else if (e.type == "keypress" || e.type == "keydown")
whichCode = e.keyCode;
else whichCode = e.button;
return (whichCode == keyCode);
}
function ctrlEnter(e){
var ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
if(ie){
if(event.ctrlKey && window.event.keyCode==13){doSomething();}
}else{
if(isKeyTrigger(e,13,true)){doSomething();}
}
}
function doSomething(){alert('Ctrl+Enter being Pressed.'); }
</script>
<textarea name="message" οnkeyup="javascript:return ctrlEnter(event);">Ctrl+Enter Submit test</textarea>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<script type="text/javascript">
function isKeyTrigger(e,keyCode){
var argv = isKeyTrigger.arguments;
var argc = isKeyTrigger.arguments.length;
var bCtrl = false;
if(argc > 2){
bCtrl = argv[2];
}
var bAlt = false;
if(argc > 3){
bAlt = argv[3];
}
var nav4 = window.Event ? true : false;
if(typeof e == 'undefined') {
e = event;
}
if( bCtrl &&
!((typeof e.ctrlKey != 'undefined') ?
e.ctrlKey : e.modifiers & Event.CONTROL_MASK > 0)){
return false;
}
if( bAlt &&
!((typeof e.altKey != 'undefined') ?
e.altKey : e.modifiers & Event.ALT_MASK > 0)){
return false;
}
var whichCode = 0;
if (nav4) whichCode = e.which;
else if (e.type == "keypress" || e.type == "keydown")
whichCode = e.keyCode;
else whichCode = e.button;
return (whichCode == keyCode);
}
function ctrlEnter(e){
var ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
if(ie){
if(event.ctrlKey && window.event.keyCode==13){doSomething();}
}else{
if(isKeyTrigger(e,13,true)){doSomething();}
}
}
function doSomething(){alert('Ctrl+Enter being Pressed.'); }
</script>
<textarea name="message" οnkeyup="javascript:return ctrlEnter(event);">Ctrl+Enter Submit test</textarea>
</body>
</html>