SoFunction
Updated on 2025-02-28

js implements the effect of pressing Ctrl+Enter to send

1. Listen to the textarea onkeydown event

Copy the codeThe code is as follows:

<textarea tabindex="1" class="ie6ta" name="" onkeydown="keySend(event);" title="Click ctrl+enter to send directly"></textarea>

2, Send the form and reload the opener window (see 4,)
function sbFrm() {
var Contenthf=("Contenthf");
var txtAr = ("textarea")[0];
if ( == "") {
();
return false;
}
();
();
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 ( &&  == 13) {
sbFrm();
}
}

4. If the current page is opened by () method, add a reload function to this page.

function afterReload() {
setTimeout(function () {
();
}, 1000);
}