Variable is not set when edit box loses focus on iPads & Android tablets

Jun 07, 2023

Hi All,

I am having problems with a variable not getting set on iPads and Android tablets when the learner changes focus. This doesn't appear to be an issue on PCs or Macs.

Before the learner can take an exam the proctor needs to be validated. The proctor puts his is ID number and then clicks on a button that submits the number to a database using javascript. If the ID is validated the learner automatically goes to the next page, if not they get an error message. We've been using this system for a while - 1st in Captivate and we switched over to Storyline maybe a year or two ago. Basically, it works pretty well most of the time.  A few months ago, we started getting calls where the proctor number was not getting validated when the learner was on a tablet. We worked the backend and couldn't see any issues, so I decided look into the focus issue.

I added another button to force the learner to click on the screen to change the focus and set the variable before clicking the submit button and executing the javascript. I also added in a state change on the submit button so that it couldn't get clicked until the "Enter" button was clicked and the variable was not blank. That seemed to work for the iPads we tested on but it was intermittent on Android phones and tablets. (Keep in mind we only tested on two iPads.)

In testing on Android phones and tablets I can click the enter button, all over the screen and most of the time the variable is NOT updating. Occasionally I'll get a focus change and set the variable.  I can consistently set the variable by using the Previous button, then Next, to come back to this slide. At that point the variable is set and I can click the return button to change the state of the Submit button. Not a reasonable workaround. 

I've attached a screen shot which shows the triggers.

Any suggestions would be appreciated. Thanks.

Update - You can see that the variable updates as soon as I hit the previous button. See the attached gif.

 

3 Replies
Sandeep Gadam

Hello Margaret, Hope you're doing well!!

Would you be willing to share your project file here with that particular slide that you're facing issue with so that either me/someone can take a look and assist you with it?

Additionally, since it's text entry field, have you tried using "JS loose focus" method? If not just give it a try and follow these steps:

Add a new Execute JavaScript to the existing Submit button
Place the following code "document.activeElement.blur();" within the JS console
Move the trigger to the top so that this new triggers fires up first upon clicking on the Submit button.

Let me know if that helps.