Hello all,
I am trying to disable the enter-key on the description field for classifieds ads. The reason is that I want all text people enter to be shown in one block and not in paragraphs.
I tried this:
<script type="text/javascript">
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
}
document.onkeypress = stopRKey;
</script>
It should disable the enter-key (13) but it does not work.
Does anyone have an idea how to make it work, or perhaps another code or snippet?