Если очень нужен переход по энтеру вот:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
</head>
<body>
<form method="post" id="k">
<input type="text" id="login" tabindex="1" autocomplete="on" name="login" value="" style="margin-left:17px;"><br>
<input type="password" id="pasmain" name="pasmain" tabindex="2" autocomplete="on" value="" style="margin-left:17px;"><br>
<input type="button" onclick="log_in();" value="Login" class="ok" id="all">
</form>
<script>
$("#k > input").keypress(function(event) {
if(event.keyCode==13 && !$(this).is(":button")){
$(this).nextAll("input, textarea")[0].focus();
}
});
</script>
</body>
</html>