Skip to main content
teresah9791625
Known Participant
April 18, 2017
Question

text align of text entry box

  • April 18, 2017
  • 1 reply
  • 308 views

I am using captivate 9.0.2.437. My project is published to html5.

I have a text entry box that needs to be aligned right. I do not see this as an option in captivate, so I am trying to set it with javascript in slide On Enter. When I publish it and run in browser, and get to the slide with the javascript I get error Unable to get property 'style' of undefined or null reference. However if I click the browser refresh button, it properly displays the text entry box with text-aligned right. It seems to me it like it is an issue of the browser is executing my javascript before the slide is completely displayed.

Here is the javascript I have in the On Enter:

var alignValue = "right";

var div = document.getElementById ("Num_Entry_Box_8_inputField");

div.style.textAlign = alignValue;

Does anyone have any ideas for getting this to work without having to refresh the browsers? Thank you.

    This topic has been closed for replies.

    1 reply

    teresah9791625
    Known Participant
    April 19, 2017

    I made a mistake, it does not work on refresh like I originally posted. Does anyone have any suggestions for aligning the text entry box to the right?