Summary: | Enter in the username field submits the login, instead of moving focus to the password field | ||
---|---|---|---|
Product: | Koha | Reporter: | Donna <bwsdonna> |
Component: | Self checkout | Assignee: | Lucas Gass (lukeg) <lucas> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | aleisha, cslone, lucas, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.11.00, 20.05.01
|
|
Circulation function: | |||
Attachments: |
Bug 25349: Add checkEnter function and apply it to SCO page
Bug 25349: Add checkEnter function and apply it to SCO page Bug 25349: Add checkEnter function and apply it to SCO page Bug 25349: Add checkEnter function and apply it to SCO page Bug 25349: Add checkEnter function and apply it to SCO page Bug 25349: Add checkEnter function and apply it to SCO page |
Description
Donna
2020-05-01 17:40:29 UTC
I think submitting a form by pressing Enter is a default behavior for form submission and I will be interested to hear what others say about this. In the meantime this javascript in the SCOUserJS system preference can alleviate the problem: (at least for US keyboards) document.getElementById("patronlogin").onkeypress = function(e) { var key = e.charCode || e.keyCode || 0; if (key == 13) { document.getElementById("patronpw").focus(); return false; } } The staff client has a globally-available checkEnter function which we use in multiple places. The same could easily be added to the OPAC. Created attachment 104378 [details] [review] Bug 25349: Add checkEnter function and apply it to SCO page This patch adds the checkEnter function to the OPAC global.js and then applies it to the SCO login page. TO TEST: 1. Go to SCO login and try entering something in the "Login:" input amd "Password:" input. 2. Pressing enter while in either will automatically submit the form. 3. Apply patch. 4. Repeat step 1-2. 5. This time the form should not submit itself when you press Enter. Created attachment 105446 [details] [review] Bug 25349: Add checkEnter function and apply it to SCO page This patch adds the checkEnter function to the OPAC global.js and then applies it to the SCO login page. TO TEST: 1. Go to SCO login and try entering something in the "Login:" input amd "Password:" input. 2. Pressing enter while in either will automatically submit the form. 3. Apply patch. 4. Repeat step 1-2. 5. This time the form should not submit itself when you press Enter. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> It works! :D However, is there a reason for the password field to not submit the form when hitting enter? Wait, title says that hitting enter in the login field should move focus to the password field. But the patch only mentions not sending the form. So what are the current specs? For the above point and the above comment. Good point Victor, Currently it will not submit the form by pressing enter in either of the fields. But maybe it would be better workflow if it DID submit the form when pressing enter in the 2nd field (password)? (In reply to Lucas Gass from comment #7) > Good point Victor, > > Currently it will not submit the form by pressing enter in either of the > fields. But maybe it would be better workflow if it DID submit the form when > pressing enter in the 2nd field (password)? This would be the ideal behavior. Failing qa here and will submit a new patch ASAP Created attachment 105533 [details] [review] Bug 25349: Add checkEnter function and apply it to SCO page This patch adds the checkEnter function to the OPAC global.js and then applies it to the SCO login page. TO TEST: 1. Go to SCO login and try entering something in the "Login:" input amd "Password:" input. 2. Pressing enter while in either will automatically submit the form. 3. Apply patch. 4. Type something into the Login: field and press enter, the form should NOT submit. 5. Type something into the Password: field and pess enter, this SHOULD submit the form. 6. Change the syspref SelfCheckoutByLogin to 'Cardnumber' 7. TType something into the Please enter your card number: field, the form should NOT submit. I changed how this patch functions so I am reseting to Needs Sign-off, I also removed Victor's sign-off line. Created attachment 105556 [details] [review] Bug 25349: Add checkEnter function and apply it to SCO page This patch adds the checkEnter function to the OPAC global.js and then applies it to the SCO login page. TO TEST: 1. Go to SCO login and try entering something in the "Login:" input amd "Password:" input. 2. Pressing enter while in either will automatically submit the form. 3. Apply patch. 4. Type something into the Login: field and press enter, the form should NOT submit. 5. Type something into the Password: field and pess enter, this SHOULD submit the form. 6. Change the syspref SelfCheckoutByLogin to 'Cardnumber' 7. Type something into the Please enter your card number: field, the form should submit. Created attachment 105557 [details] [review] Bug 25349: Add checkEnter function and apply it to SCO page This patch adds the checkEnter function to the OPAC global.js and then applies it to the SCO login page. TO TEST: 1. Go to SCO login and try entering something in the "Login:" input amd "Password:" input. 2. Pressing enter while in either will automatically submit the form. 3. Apply patch. 4. Type something into the Login: field and press enter, the form should NOT submit. 5. Type something into the Password: field and pess enter, this SHOULD submit the form. 6. Change the syspref SelfCheckoutByLogin to 'Cardnumber' 7. Type something into the Please enter your card number: field, the form should submit. Signed-off-by: Donnab <donna@bywatersolutions.com> Created attachment 105858 [details] [review] Bug 25349: Add checkEnter function and apply it to SCO page This patch adds the checkEnter function to the OPAC global.js and then applies it to the SCO login page. TO TEST: 1. Go to SCO login and try entering something in the "Login:" input amd "Password:" input. 2. Pressing enter while in either will automatically submit the form. 3. Apply patch. 4. Type something into the Login: field and press enter, the form should NOT submit. 5. Type something into the Password: field and pess enter, this SHOULD submit the form. 6. Change the syspref SelfCheckoutByLogin to 'Cardnumber' 7. Type something into the Please enter your card number: field, the form should submit. Signed-off-by: Donnab <donna@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 20.11, thanks to everybody involved! backported to 20.05.x for 20.05.01 this doesn't appear to fix the bug on 19.11.x, the form still submits when pressing enter in the username box. not backported |