This should do the trick:

$("yourSelector").keydown(function(e){
	if (e.keyCode == 13) {
		$("yourSelector").submit();
	}
});
-Marshall


Arne-Kolja Bachstein wrote:

Hi there,

 

is it possible to bind a keydown event to intercept the enter/return key? I have a form that is submitted manually and does not have form tags around it (can’t do this, restriction of the cms I am using)… and now it – of course – doesn’t react with a “start search” when hitting return after entering a search phrase. So I would need to bind a keydown event to the corresponding input fields that reacts on pressing enter/return…

 

Thanks in advance,

 

Arne

 

 




Reply via email to