The JavaScript file prevent_submit.js seems to be doing the same work that the .noEnterSubmit CSS class does via staff-global.js. If so, the extra file should be removed and the templates modified to work with staff-global.js.
Created attachment 85539 [details] [review] Bug 15911: Use noEnterSubmit CSS class instead of prevent_submit.js This patch removes the use of a separate js file, prevent_submit.js, in favor of using a CSS class to trigger the same functionality in staff-global.js. To test, apply the patch and test the following pages to confirm that pressing "Enter" when the cursor is in any field in the main form does not submit the form. - In Acquisitions, add to a basket from a new (empty) record - In Acquisitions, receive an order line - In Serials, locate a subscription and open the "Edit serials" page from the "Serial collection" page.
Created attachment 86046 [details] [review] Bug 15911: Use noEnterSubmit CSS class instead of prevent_submit.js This patch removes the use of a separate js file, prevent_submit.js, in favor of using a CSS class to trigger the same functionality in staff-global.js. To test, apply the patch and test the following pages to confirm that pressing "Enter" when the cursor is in any field in the main form does not submit the form. - In Acquisitions, add to a basket from a new (empty) record - In Acquisitions, receive an order line - In Serials, locate a subscription and open the "Edit serials" page from the "Serial collection" page. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
I think the following part was important: - && e.target.nodeName == "INPUT" - && e.target.type != "submit" We want to submit form when pressing enter on the submit button, right? :)
Created attachment 86205 [details] [review] Bug 15911: (follow-up) Allow enter to submit using the submit button This patch modifies the checkEnter function so that it is possible to submit a form by tabbing to the submit button and hitting ENTER to submit.
Created attachment 86412 [details] [review] Bug 15911: Use noEnterSubmit CSS class instead of prevent_submit.js This patch removes the use of a separate js file, prevent_submit.js, in favor of using a CSS class to trigger the same functionality in staff-global.js. To test, apply the patch and test the following pages to confirm that pressing "Enter" when the cursor is in any field in the main form does not submit the form. - In Acquisitions, add to a basket from a new (empty) record - In Acquisitions, receive an order line - In Serials, locate a subscription and open the "Edit serials" page from the "Serial collection" page. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 86413 [details] [review] Bug 15911: (follow-up) Allow enter to submit using the submit button This patch modifies the checkEnter function so that it is possible to submit a form by tabbing to the submit button and hitting ENTER to submit. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Awesome work all! Pushed to master for 19.05
Enhancement, will not be backported to 18.11.x series.