Disable Backspace key across browsers

amak
Community Member Posts: 23
Hi there,
Has anyone had experience disabling the backspace key so users can't navigate to the previous page? We have a course that the client requested the backspace to be disabled as it causes a long string of LMSInitialize error pop ups. So far I have tried a RunJavaScript action with:
window.onkeydown = function(e) {
if (e.keyCode == 8 && e.target == document.body)
e.preventDefault();
}
This was tested in SCORM Cloud on Chrome, IE and Firefox, however IE is the only one that doesn't work.
I also tried the same code above as an external HTML object set as header scripting which gave the same result.
Does anyone have any suggestions as to how this can be achieved across multiple browsers? We are using Lectora V16.1.2.
Thanks in advance!
Has anyone had experience disabling the backspace key so users can't navigate to the previous page? We have a course that the client requested the backspace to be disabled as it causes a long string of LMSInitialize error pop ups. So far I have tried a RunJavaScript action with:
window.onkeydown = function(e) {
if (e.keyCode == 8 && e.target == document.body)
e.preventDefault();
}
This was tested in SCORM Cloud on Chrome, IE and Firefox, however IE is the only one that doesn't work.
I also tried the same code above as an external HTML object set as header scripting which gave the same result.
Does anyone have any suggestions as to how this can be achieved across multiple browsers? We are using Lectora V16.1.2.
Thanks in advance!
Comments
-
Hi again,
I've also tried adding a keystroke action to the title level, set the key to "backspace" and left the action as "No action" but this still didn't work. Setting the action to GoTo, Target: Current Page, Scroll to: Top of Page, Open in: Existing Window also didn't work in IE11 and Firefox. -
My initial response to this is "NOOOOOOO!!!!!" for accessibility reasons. However, I did a quick StackOverflow search and found that it may be possible and there's a working demo in the thread.
If you absolutely have to do this, I would say that you have to heavily emphasize this prior to the user entering the section. For keyboard only or screen reader users, this is a significant barrier.
Realistically, I would emphasize that would not be compliant with ADA and WCAG and recommend they work with their LMS to get this fixed. Otherwise, they are putting themselves at risk for a lawsuit. Even private business are subject to the regulations and susceptible to litigation. -
Hi Jason,
Thanks for your reply! Accessibility is a factor in this course and is addressed early on with an option for a text based version. So while the course won't necessarily be 'accessible' the alternative text version will cater to those who require it. I gave the StackOverflow link a go and it worked to a certain extent. The message would pop up if I tried going back or clicking the backspace key, however it would also pop up whenever I wanted to progress through the course with the navigation buttons built into the course. I'll keep trying though! -
Hi everyone,
The client has indicated that in fact disabling the backspace key isn't required but rather it should be replaced with another function. So a backspace keystroke action has been used with the Exit/Close action. No LMSInitialize error pop ups appear when the backspace is clicked and it simply closes the course. Bookmarking is enabled so learners can return and continue from where they left off.
Also, as advised by Microsoft, disabling the backspace can't be done in IE:
It is by-design; you cannot disable the backspace option on internet explorer.
https://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/how-do-i-disable-the-backspace-button-on-the/0e2cf333-1f0d-474d-800f-56a6da17f083
Categories
- 35.8K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 321 CenarioVR®
- 188 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products