I have a form in a jQuery enabled site. The form does not feature an <input type="submit">
button. For that reason, it's not submitted when you hit enter. What's the recommended way to emulate such behaviour?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head><title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript"><!--
$(function(){
$("form input:first").focus();
});
//--></script>
</head>
<body>
<form action="" method="post">
<input type="text" name="user">
<input type="password" name="pass">
</form>
</body>
</html>
Update
I'm just trying to add a quick simple improvement to an existing form. I fully understand all the concerns about accessibility but the app itself needs JavaScript and will not run at all without it. A fallback to submit the form would be of little use.