I have a survey on a website, and there seems to be some issues with the users hitting enter (I don\'t know why) and accidentally submitting the survey (form) without clicki
I'd like to add a little CoffeeScript code (not field tested):
$ -> $(window).bind 'keypress', (event) -> if event.keyCode == 13 unless {'TEXTAREA', 'SELECT'}[event.originalEvent.srcElement.tagName] event.preventDefault()
(I hope you like the nice trick in the unless clause.)