from表单提交设置快捷键 ,“ctrl”+'enter'
是设置accesskey属性吗,如何设置

解决方案 »

  1.   

    自己搜下 event keycode  一搜一大把~~ 找到对应的key 设置事件就可以了很简单
      

  2.   

    注册keydown事件window.onload=function(){
      documen.getElementById('表单ID').onkeydown=function(e){
        e=e||window.event;
        if(e.ctrlKey&&e.keyCode==13)this.submit()
      }
    }
      

  3.   

    <!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=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function init(){
    document.onkeydown=function(e){
    var a=e||window.event;
    if(a.ctrlKey&&a.keyCode==13){
    alert("a");
    }
    }
    }
    window.onload=init;
    </script>
    </head><body>
    </body>
    </html>
    试试
      

  4.   

    貌似表单提交默认是“Enter”,但看现在csdn论坛是:(Ctrl+Enter)不知csdn是如何做得
      

  5.   

    不都告诉你了,就是注册事件了   $("#post_body").keypress(function(e){var t=e.which?e.which:e.keyCode;if(t===10||t==13&&e.ctrlKey){var n=$(this).closest("form"),r=n.find("#submit_new_post_form");r.prop("disabled")!==!0&&n.submit()}});
      

  6.   

    哦,谢谢各位啦,我没有说详细,我用得是kindeditor编辑器
    这个方法:
    KE.show({
    id : 'content1',
    imageUploadJson : '../../php/upload_json.php',
    fileManagerJson : '../../php/file_manager_json.php',
    allowFileManager : true,
    afterCreate : function(id) {
    KE.event.ctrl(document, 13, function() {
    KE.util.setData(id);
    document.forms['example'].submit();
    });
    KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
    KE.util.setData(id);
    document.forms['example'].submit();
    });
    }
    });可以实现