Three things...
|
|
Useful script - with a few very minor issues: 1. The new line is inserted as well as the form being submitted
I believe this fixes all of these: var statusElem = document.getElementById('status');
statusElem.addEventListener('keypress', function(evt) {
if(evt.keyCode == evt.DOM_VK_RETURN && !evt.shiftKey) { // Hold shift to put in a new line
if(statusElem.value != "") // Refuse to submit empty text
statusElem.form.submit();
evt.preventDefault(); // Don't insert new line
}
}, false);
|
|
|
Hi DaveJamesMiller, Thanks for the fixes. I've incorporated those into the latest version. Ziru |