[Koha-bugs] [Bug 11563] Class noEnterSubmit no longer functioning

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 19 10:11:15 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11563

Jonathan Druart <jonathan.druart at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #25676|0                           |1
        is obsolete|                            |

--- Comment #13 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Created attachment 26443
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26443&action=edit
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 at bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart at biblibre.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list