Puoi usare jquery
codice:
<html>
	<head>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
		<script type="text/javascript">
		$(document).ready(function() {
			$('#password').keydown(function(event) {
				if (event.keyCode == 13) {
					this.form.submit();
					return false;
				}
			});
		});
		</script>
	</head>
	<body>
		<form type="get">
			<input name="username" id="username" type="text" placeholder="username"/>
			<input name="password" id="password" type="password" placeholder="password"/>
		</form>
	</body>
</html>
<?php
//Solo per controllo
echo print_r($_GET);
?>