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
$(document).on("keydown","form", function(event) { node = event.target.nodeName.toLowerCase(); type = $(event.target).prop('type').toLowerCase(); if(node!='textarea' && type!='submit' && (event.keyCode == 13 || event.keyCode == 169)) { event.preventDefault(); return false; } });
It works perfectly!