[jQuery] can't get hotkeys working in input fieldssdfsd
Hi,
i'm trying to use the js-hotkeys plugin for determining when a
user has pressed 'enter' in a textbox or input element. i've tried
this code under firefox 3 and safari under mac os x, with jquery 1-3.2
and js-hotkeys .7.8, and it does not work:
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript" src="jquery.hotkeys-0.7.8.js"></script>
<script>
$('.go_to').bind('keydown', 'return', function(evt) {
alert('foo');
evt.stopPropagation();
evt.preventDefault();
return false; } );
</script>
</head>
<body>
<input type="text" class="go_to">test</input>
</body>
</html>
i don't get any errors, nor do i get an alert box indicating it's
working.
initially i was doing this:
$('.go_to').bind('keydown', 'return', alert('foo') );
but that was just firing the alert every time i loaded the page
any suggestions?
thanks