Skip to content

Commit c0514ba

Browse files
committed
prevent formsubmit by pressing enter in inputfields
Fixxes puphpet#1228
1 parent aaaa2aa commit c0514ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web/assets/v4/js/custom.js

+5
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,10 @@ PUPHPET.scrollTo = function() {
695695
});
696696
};
697697

698+
PUPHPET.disableEnterSubmit = function() {
699+
$('input,select').keypress(function(event) { if(event.keyCode == 13) event.preventDefault(); });
700+
};
701+
698702
$(document).ready(function() {
699703
PUPHPET.updateOtherInput();
700704
PUPHPET.updateOtherInputSelect();
@@ -714,4 +718,5 @@ $(document).ready(function() {
714718
PUPHPET.hideOnNotInstalled();
715719
PUPHPET.submitUncheckedCheckboxes();
716720
PUPHPET.scrollTo();
721+
PUPHPET.disableEnterSubmit();
717722
});

0 commit comments

Comments
 (0)