1. Listen to the onkeydown event of textarea
function sbFrm() { var Contenthf=document.getElementById("Contenthf"); var txtAr = Contenthf.getElementsByTagName("textarea")[0]; if (txtAr.innerHTML == "") { txtAr.focus(); return false; } Contenthf.submit(); window.opener.afterReload(); return false; }
3. When the ctrl key is pressed and the keycode is 13 (Enter), the function that sends the form is called.
function keySend(event) { if (event.ctrlKey && event.keyCode == 13) { sbFrm(); } }
4. If it is the current page opened by window.open(), add a reload function to the page of window.open
function afterReload() { setTimeout(function () { window.location.reload(); }, 1000); }