CrazzyBerg,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<form action="http://" >
<input type="text" class="form-control" id="txtCommand" >
<input name="" type="submit" value="Отправить">
</form>
<script>
var fn = function(a) {
var b;
document.getElementById(a).onkeypress = function() {
b = event.keyCode
};
document.forms[0].onsubmit = function() {
var a = 13 != b;
b = "";
return a
}
}("txtCommand");
</script>
</body>
</html>
|