For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered!
This behavior is not present in 3.12.7, but it is present on 3.15 in the sandboxes. I do not know if this is affecting 3.14. Christopher
This probably also has to do with the report of scanners submitting new borrowers early in 3.14.
(In reply to Liz Rea from comment #2) > This probably also has to do with the report of scanners submitting new > borrowers early in 3.14. I would agree with that assessment, since scanner input often sends a CR signal. Christopher
Created attachment 25615 [details] [review] Bug 11563 - Class noEnterSubmit no longer functioning For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered. This is because this class is added using JavaScript in $(document).ready() and the keypress event listerning is also set using $(document).ready(). This patch corrects by using JQuery live() with will set event listerning event for HTML generated with JavaScript. Alos sets noEnterSubmit to use the checkEnter(e) function, containing a more correct code. Also corrects a small bug, for IE, window.event must be used, not event alone (even if IE is not supported for intranet). Test plan : - Flush browser cache (Crtl+F5) to update js files - Go to patron creation : members/memberentrygen.tt - Type a text in all mandatory inputs - Type some caracters in a non mandatory input - Press Enter key => Without patch : the form is submitted => With patch : the form is not submitted - Try to set several lines in a textarea => It works (checks that in this case enter key is allowed) - Test other pages usign noEnterSubmit class : cataloguing/additem.tt course_reserves/course.tt members/mancredit.tt members/maninvoice.tt patron_lists/list.tt
Bug 11521 is a duplicate no ?
Created attachment 25676 [details] [review] Bug 11563 - Class noEnterSubmit no longer functioning For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered. This is because this class is added using JavaScript in $(document).ready() and the keypress event listerning is also set using $(document).ready(). This patch corrects by using JQuery live() with will set event listerning event for HTML generated with JavaScript. Alos sets noEnterSubmit to use the checkEnter(e) function, containing a more correct code. Also corrects a small bug, for IE, window.event must be used, not event alone (even if IE is not supported for intranet). Test plan : - Flush browser cache (Crtl+F5) to update js files - Go to patron creation : members/memberentrygen.tt - Type a text in all mandatory inputs - Type some caracters in a non mandatory input - Press Enter key => Without patch : the form is submitted => With patch : the form is not submitted - Try to set several lines in a textarea => It works (checks that in this case enter key is allowed) - Test other pages usign noEnterSubmit class : cataloguing/additem.tt course_reserves/course.tt members/mancredit.tt members/maninvoice.tt patron_lists/list.tt Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
*** Bug 11521 has been marked as a duplicate of this bug. ***
Created attachment 25678 [details] [review] Bug 11563 [QA Followup] - Change .live() to .on() The jquery event handler .live() has been deprecated. It is recommended that .on() be used instead.
Indeed, live is deprecated in jQuery 1.7 https://api.jquery.com/live/
Created attachment 25935 [details] [review] Bug 11563 [QA Followup] - Disable add noEnterSubmit to pulldowns When using Chrome on Mac OS X, form submits are triggered by hitting enter when focused on a select. This is not an issue with any other combincation of browser and operating system that I am aware of.
(In reply to Kyle M Hall from comment #10) > Created attachment 25935 [details] [review] [review] > Bug 11563 [QA Followup] - Disable add noEnterSubmit to pulldowns > > When using Chrome on Mac OS X, form submits are triggered by hitting > enter when focused on a select. This is not an issue with any other > combincation of browser and operating system that I am aware of. In this case, shall we add noEnterSubmit on select also ? I think it does not impact other browser/OS combination.
QA comment: I did not test on all pages and I only test with Firefox, it works! Marked as Passed QA.
Created attachment 26443 [details] [review] Bug 11563 - Class noEnterSubmit no longer functioning For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered. This is because this class is added using JavaScript in $(document).ready() and the keypress event listerning is also set using $(document).ready(). This patch corrects by using JQuery live() with will set event listerning event for HTML generated with JavaScript. Alos sets noEnterSubmit to use the checkEnter(e) function, containing a more correct code. Also corrects a small bug, for IE, window.event must be used, not event alone (even if IE is not supported for intranet). Test plan : - Flush browser cache (Crtl+F5) to update js files - Go to patron creation : members/memberentrygen.tt - Type a text in all mandatory inputs - Type some caracters in a non mandatory input - Press Enter key => Without patch : the form is submitted => With patch : the form is not submitted - Try to set several lines in a textarea => It works (checks that in this case enter key is allowed) - Test other pages usign noEnterSubmit class : cataloguing/additem.tt course_reserves/course.tt members/mancredit.tt members/maninvoice.tt patron_lists/list.tt Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 26444 [details] [review] Bug 11563 [QA Followup] - Change .live() to .on() The jquery event handler .live() has been deprecated. It is recommended that .on() be used instead. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 26445 [details] [review] Bug 11563 [QA Followup] - Disable add noEnterSubmit to pulldowns When using Chrome on Mac OS X, form submits are triggered by hitting enter when focused on a select. This is not an issue with any other combincation of browser and operating system that I am aware of. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
(In reply to Fridolin SOMERS from comment #11) > In this case, shall we add noEnterSubmit on select also ? > I think it does not impact other browser/OS combination. It is not what the last patch does?
(In reply to Jonathan Druart from comment #16) > (In reply to Fridolin SOMERS from comment #11) > > In this case, shall we add noEnterSubmit on select also ? > > I think it does not impact other browser/OS combination. > > It is not what the last patch does? No, this patch corrects behaviors for elements with "noEnterSubmit" class. But this class in actually only set on "input" elements : $("fieldset.rows input").addClass("noEnterSubmit");
(In reply to Fridolin SOMERS from comment #17) > But this class in actually only set on "input" elements : > $("fieldset.rows input").addClass("noEnterSubmit"); No, the *last* patch does the following : - $("fieldset.rows input").addClass("noEnterSubmit"); + $("fieldset.rows input,select").addClass("noEnterSubmit"); :)
(In reply to Jonathan Druart from comment #18) > (In reply to Fridolin SOMERS from comment #17) > > But this class in actually only set on "input" elements : > > $("fieldset.rows input").addClass("noEnterSubmit"); > > No, the *last* patch does the following : > - $("fieldset.rows input").addClass("noEnterSubmit"); > + $("fieldset.rows input,select").addClass("noEnterSubmit"); > > :) Ohhhhhh, sorry I had not seen this patch. @Kyle : I think the JQuery selector is not correct : $("fieldset.rows input,select").addClass("noEnterSubmit"); should be : $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); Also, the pages mancredit.tt and maninvoice.tt are also using noEnterSubmit class. They should have the same JS code no ?
Created attachment 26545 [details] [review] Bug 11563: (followup) Disable add noEnterSubmit to pulldowns Test plan: To test on modified pages: - Press enter when cursor is on input or select and verify the form is not submitted.
I can't sign off on this. I tested memberentry.pl, and the class is not added: <input type="submit" value="Save" onclick="return check_form_borrowers();" name="save"> mancredit.pl also fails: <input type="submit" value="Add credit" name="add"> It does not look like the jquery is applying the modification. Christopher
I think the correct code would read: $("fieldset input, fieldset select").addClass("noEnterSubmit"); The .row misdirects the selector. I've tested this, and this applies correctly. However, I am not a patch writer. I'll leave that to you guys. Christopher
The class noEnterSubmit should be added to input and select elements in the form. Not on the submit button/input.
Well, ignore my comments. For some reason, it wasn't working at first. Now it is. Sorry guys. Don't know why this happens. I can confirm it works now.
Patch tested with a sandbox, by Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 26560 [details] [review] Bug 11563 - Class noEnterSubmit no longer functioning For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered. This is because this class is added using JavaScript in $(document).ready() and the keypress event listerning is also set using $(document).ready(). This patch corrects by using JQuery live() with will set event listerning event for HTML generated with JavaScript. Alos sets noEnterSubmit to use the checkEnter(e) function, containing a more correct code. Also corrects a small bug, for IE, window.event must be used, not event alone (even if IE is not supported for intranet). Test plan : - Flush browser cache (Crtl+F5) to update js files - Go to patron creation : members/memberentrygen.tt - Type a text in all mandatory inputs - Type some caracters in a non mandatory input - Press Enter key => Without patch : the form is submitted => With patch : the form is not submitted - Try to set several lines in a textarea => It works (checks that in this case enter key is allowed) - Test other pages usign noEnterSubmit class : cataloguing/additem.tt course_reserves/course.tt members/mancredit.tt members/maninvoice.tt patron_lists/list.tt Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 26561 [details] [review] Bug 11563 [QA Followup] - Change .live() to .on() The jquery event handler .live() has been deprecated. It is recommended that .on() be used instead. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 26562 [details] [review] Bug 11563 [QA Followup] - Disable add noEnterSubmit to pulldowns When using Chrome on Mac OS X, form submits are triggered by hitting enter when focused on a select. This is not an issue with any other combincation of browser and operating system that I am aware of. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 26563 [details] [review] Bug 11563: (followup) Disable add noEnterSubmit to pulldowns Test plan: To test on modified pages: - Press enter when cursor is on input or select and verify the form is not submitted. Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 26566 [details] [review] Bug 11563 - Class noEnterSubmit no longer functioning For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered. This is because this class is added using JavaScript in $(document).ready() and the keypress event listerning is also set using $(document).ready(). This patch corrects by using JQuery live() with will set event listerning event for HTML generated with JavaScript. Alos sets noEnterSubmit to use the checkEnter(e) function, containing a more correct code. Also corrects a small bug, for IE, window.event must be used, not event alone (even if IE is not supported for intranet). Test plan : - Flush browser cache (Crtl+F5) to update js files - Go to patron creation : members/memberentrygen.tt - Type a text in all mandatory inputs - Type some caracters in a non mandatory input - Press Enter key => Without patch : the form is submitted => With patch : the form is not submitted - Try to set several lines in a textarea => It works (checks that in this case enter key is allowed) - Test other pages usign noEnterSubmit class : cataloguing/additem.tt course_reserves/course.tt members/mancredit.tt members/maninvoice.tt patron_lists/list.tt Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26567 [details] [review] [PASSED QA] Bug 11563 [QA Followup] - Change .live() to .on() The jquery event handler .live() has been deprecated. It is recommended that .on() be used instead. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26568 [details] [review] [PASSED QA] Bug 11563 [QA Followup] - Disable add noEnterSubmit to pulldowns When using Chrome on Mac OS X, form submits are triggered by hitting enter when focused on a select. This is not an issue with any other combincation of browser and operating system that I am aware of. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26569 [details] [review] [PASSED QA] Bug 11563: (followup) Disable add noEnterSubmit to pulldowns Test plan: To test on modified pages: - Press enter when cursor is on input or select and verify the form is not submitted. Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26570 [details] [review] [PASSED QA] Bug 11563 - Class noEnterSubmit no longer functioning For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered. This is because this class is added using JavaScript in $(document).ready() and the keypress event listerning is also set using $(document).ready(). This patch corrects by using JQuery live() with will set event listerning event for HTML generated with JavaScript. Alos sets noEnterSubmit to use the checkEnter(e) function, containing a more correct code. Also corrects a small bug, for IE, window.event must be used, not event alone (even if IE is not supported for intranet). Test plan : - Flush browser cache (Crtl+F5) to update js files - Go to patron creation : members/memberentrygen.tt - Type a text in all mandatory inputs - Type some caracters in a non mandatory input - Press Enter key => Without patch : the form is submitted => With patch : the form is not submitted - Try to set several lines in a textarea => It works (checks that in this case enter key is allowed) - Test other pages usign noEnterSubmit class : cataloguing/additem.tt course_reserves/course.tt members/mancredit.tt members/maninvoice.tt patron_lists/list.tt Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works as described, tested in Firefox and Chromium. Passes tests and QA script.
Created attachment 26571 [details] [review] [PASSED QA] Bug 11563 [QA Followup] - Change .live() to .on() The jquery event handler .live() has been deprecated. It is recommended that .on() be used instead. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26572 [details] [review] [PASSED QA] Bug 11563 [QA Followup] - Disable add noEnterSubmit to pulldowns When using Chrome on Mac OS X, form submits are triggered by hitting enter when focused on a select. This is not an issue with any other combincation of browser and operating system that I am aware of. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26573 [details] [review] [PASSED QA] Bug 11563: (followup) Disable add noEnterSubmit to pulldowns Test plan: To test on modified pages: - Press enter when cursor is on input or select and verify the form is not submitted. Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Pushed to master. Thanks, Fridolin!
Pushed to 3.14.x, will be in 3.14.07
Same problem in 3.16.4. Needs to fix file intranet-tmpl/prog/*LANG*/js/cataloging.js In LINE 486 erase 'noEnterSubmit' parameter in function addClass. - $(".input_marceditor, .indicator").addClass('noEnterSubmit'); + $(".input_marceditor, .indicator").addClass('');
Hi Bondiurbano, can you please open a separate bug (linking to this) with a problem description? I think if the problem is in 3.16.4 it's likely also in master, so this version should be used.
(In reply to Katrin Fischer from comment #41) > Hi Bondiurbano, can you please open a separate bug (linking to this) with a > problem description? > > I think if the problem is in 3.16.4 it's likely also in master, so this > version should be used. DONE! See bug 13080 addClass('noEnterSubmit') no longer functioning for 5xx tags while cataloging Thank you Katrin!