How to submit a form on press enter key

Jquery

Posted on 06 Oct 15 by Vickey
  364



<script src="jquery.min.js"></script>
<script>
    $(document).keypress(function(e) {
    if (e.which==13) {
        $("#formid").submit();
    }
});
</script>

 

<form action="/" id="formid" method="get">
	<input name="text">
</form>

 


If this post help you reduce time to develop, you can help me to maintain this website :)
www.000webhost.com