Entry Text WITHOUT Losing Focus

Hi all,

Is it possible to detect/trigger entry text content WHILE the user is typing? And not wait until the box loses focus? 

Here's the scenario: submit button is hidden. Text entry is empty. User clicks in the text entry. Text entry gains focus. But, I don't want to show the button yet, since the content is empty. Now, once the user types in a letter, I want the button to show up. If the user deletes the content (backspace), then I want the button to hide again. Also, people may copy-paste content into the box, so I can't rely on key pressed. Thoughts?

Thanks!

 

8 Replies
Matthew Bibby

I don't think it's possible Zsolt. I tried to figure this out a year or so back with no success.

As you know, the text isn't saved to the variable until the field loses focus, so 'when variable changes' triggers don't work. 

If the variable was updated each time the contents of the text entry field changed (i.e., each key press or when text was pasted) it would open up a lot of possibilities.

The only option I can think of is building a text box outside of Storyline and adding it via a web object, using JS to pass the value to SL. But we both know that's far from an ideal solution.

Jillian Rae

I thought I'd put this here in case anybody finds it useful. This problem was driving me crazy and I didn't like any of the suggested solutions. I solved it using jQuery because I'm still using Storyline 3, but I'm sure you could achieve the same thing in a slightly more long-winded way with straight javascript.

I created an Execute JavaScript trigger to run at timeline start:

$(function() {
  $("input").keyup(function() {
    $(this).blur();
    $(this).focus();
  });
});

Basically it causes the active input element to lose focus very briefly after every keystroke, thereby activating the "control loses focus" trigger, to which you can attach any action you like on a case-by-case basis. In theory the split second loss of focus could cause problems but in practice I have yet to experience any.

Because it works on any unspecified input element you can also put it inside your Slide Master to apply to every slide.