Topic
5 replies Latest Post - ‏2013-04-17T11:27:08Z by GerardoMG
SystemAdmin
SystemAdmin
1192 Posts
ACCEPTED ANSWER

Pinned topic Disabling the keyboard on hitting the enter key

‏2013-01-21T18:13:55Z |
Hi All,

I am trying to disable the keyboard once I hit the enter key, so that the user allows normal processing and rendering to happen and does not hit any key and disrupts processing. If there any way that I can disable the keyboard from the time the enter key is pressed and till the time the next page is rendered completely.
Updated on 2013-01-25T19:31:58Z at 2013-01-25T19:31:58Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1192 Posts
    ACCEPTED ANSWER

    Re: Disabling the keyboard on hitting the enter key

    ‏2013-01-21T18:15:17Z  in response to SystemAdmin
    and I have tried

    document.getElementById('KeyboardToggle').value = "0";

    but this doesnt seem to help either
    • tmparker
      tmparker
      484 Posts
      ACCEPTED ANSWER

      Re: Disabling the keyboard on hitting the enter key

      ‏2013-01-22T15:12:10Z  in response to SystemAdmin
      I'm not sure what you are seeing now but the default behavior of HATS is that once an aid key is sent and the page is submitted you won't be able to send a second aid key. There is JavaScript code that prevents this from happening. Are you seeing some different behavior then this in your application? If so, have you made any custom change to the code in your project?
      • SystemAdmin
        SystemAdmin
        1192 Posts
        ACCEPTED ANSWER

        Re: Disabling the keyboard on hitting the enter key

        ‏2013-01-22T17:40:32Z  in response to tmparker
        No I have not made any custom changes to the code in the project. What's happening is, if the user presses enter once, and as the page is loading, and the user is not patient enough to wait for the page to load, he either hits enter again or hits escape, this keyboard entry goes back to the green screen and goes to the next screen that should appear when the escape or entry goes to the green screen.
        • SystemAdmin
          SystemAdmin
          1192 Posts
          ACCEPTED ANSWER

          Re: Disabling the keyboard on hitting the enter key

          ‏2013-01-25T19:31:58Z  in response to SystemAdmin
          When the user hits enter a second time, they get the following error
          "The application is busy. One possible cause is reloading the Web page before the application is ready."
          This particularly happens when they hit the enter button before the page is ready, also when the user hits any other key as the page is being loaded, the key is sent back to the green screen and the page is rendered as per the green screen .
      • GerardoMG
        GerardoMG
        33 Posts
        ACCEPTED ANSWER

        Re: Disabling the keyboard on hitting the enter key

        ‏2013-04-17T11:27:08Z  in response to tmparker

        I have the same problem.
        No custom changes to how keys are handled.

        I solved it by overriding the 'ms'-function and having it do
        hatsForm.KeyboardToggle.value='0';
        Before calling the original ms-function. Otherwise it would not lock the keyboard on macro or key buttons.

        Also, I put a transparent div over the whole screen with a wait cursor, to prevent user from clicking links or buttons or otherwise interacting with the screen. 

        If there is a callback or some other proper way of overriding the default submit behavior I would like to know!