Forum Discussion
Setting focus to text entry box in Storyline
Hi. I think I know the answer to this, but I need to ask to make sure. I'm updating a simulation of a mainframe data system, originally recorded in Captivate six years ago. To correctly mimic the system, I need the focus of the screen to be on the text entry box from when the timeline for the slide starts, so that the student can input the data without clicking on the text entry box. In searching the forums, I found a similar query regarding Quizmaker, and this functionality was not supported in that program. I'm guessing that Storyline won't support it either.
90 Replies
Glad to hear it, Amy. Thanks for popping back in with an update.
- MarvinPatrick-dCommunity Member
Has anything more been done so a text box can be assigned focus? I understand the proposed solutions, but I'm hoping there's another way.
- ATuseniusCommunity Member
If you are using Fill-in-the-blanks slides
My colleague wrote a piece of JavaScript for me that focuses directly on the text entry field. Note that this works if you have a single TextEntry field on a fill in the blanks question slide, I do not know if it works for NumericEntry.
setTimeout(function(){
var inputs = document.querySelectorAll('.shown input[type=text][role=presentation]');
console.log('n',inputs.length)
if(inputs.length) inputs[inputs.length-1].focus();
}, 90)I put it in the trigger 'Execute Javascript when timeline starts on TextEntry'.
- JanetCCCommunity Member
Thanks Antje! That worked well. :)
- DaveCoxCommunity Member
I know that this may be an old topic, but I just had a need to do this, so I went back to my old notes to see how I got it to work. You don't have to put your elements on a master slide. Put them in the slide like you would any other slide.
To get the text box to receive focus, place the text box on a layer by itself. When you want to activate the text box, just activate the layer where it lives.
You can do it when the slide starts by setting a trigger to activate the layer when the timeline starts. You can then place anything that you want on the base layer, and the text box will receive focus when the layer that contains it is activated.
- santoshparulekaCommunity Member
Hi all,
please tell me how to show text field blink when course start. It indicate the user to fill text in that field. I am using storyline 3.
- MariaCSStaff
Hi, Santosh.
Thank you for sharing your .story file!
If you move the Text Entry field to the bottom of the timeline, the cursor should blink when the slide starts:
Let me know if this works!
- santoshparulekaCommunity Member
Hi, Maria
Great !!!
Thank you for sharing !
Clear the doubt with visual presentation.
Now a question arising, if there is background image on bottom of the timeline. It's not work....
When i remove the image from bottom of the timeline than it's work.
- DaveCoxCommunity Member
HI Santosh,
You used to be able to solve this by moving everything to layers, but that doesn't seem to work anymore. So I've created a work around that you can use.
- Insert your picture and move it to the bottom layer
- Press Ctrl-C to copy the picture, and then Ctrl-Shift D to paste the picture 3 times, so you have 4 copies. Using Ctrl-Shift D copies the pictures in the exact same location.
- Move the 3 copies to the bottom layers with the first picture.
- Use the crop tool to crop the pictures to the four sides of the input text box, one for each side.
- Select the input text box, and move it to the bottom layer.
- Your project should now run with the image showing, and the cursor blinking in the input box.
I've created an sample of how I did this for you.
- DiarmaidCollinsCommunity Member
Hi Dave. I like the way you engineered the workaround but, and I don't mean to upset you, one could always use the desired image as a background image, from within the Format Background option. This will place the image beneath the text entry box but the text entry box will still have focus because it is the bottom of the timeline.
Simple. :)
- DaveCoxCommunity Member
Hi Diarmaid,
That doesn't upset me at all. Answers from everyone is how we all learn new things, and if that works, that is great! I generally prefer to not use a background image, but it sounds like it is a another good work-around.
Dave
- santoshparulekaCommunity Member
HI Dave Cox,
Thank you for sharing !
In my course lots of fill in the blanks. But how you done is hectic work for me.
Thanks again for your valuable timing!!!
- DaveCoxCommunity Member
Hi Maria,
I think this should be something that you can do in Storyline. Please mention this to your engineering team.
Thank you,
Dave
- DavidSchwartz-fCommunity Member
Just wanted to add to this thread, as I was having difficulty with automatically setting focus to text entry and numeric entry fields. Currently using SL360 v.3.57.26407.0.
By default these fields were at the bottom of the timeline, but were not taking focus, despite the focus order. What solved this was to move them up in the timeline, and then back down to the bottom of the timeline.
- santoshparulekaCommunity Member
Hi David,
Good morning!!!
Please share the file