Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to output JS generated text to Captivate slide?

Engaged ,
Aug 31, 2016 Aug 31, 2016

I wrote some custom Javascript that generates some text. The Javascript successfully executes when the movie gets to that slide (On Enter: Execute Javascript) but I can't seem to get the generated text to appear within any Captivate screen object.

I created a Captivate text entry box, found it's ID value and tried using the Javascript call:

document.getElementById("myTextBox_inputField").innerHTML="Text from Javascript";

but I can't seem to get the text from my Javascript output to a Captivate object. I feel like I'm missing something obvious with this one....

Thanks in advance,

Rich

TOPICS
Advanced
574
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2016 Aug 31, 2016

You have to store that text in a user variable, defined in Captivate, which can be displayed in a text container.

Use the method SetVariableValue which is available in the common JS API for Captivate. More details:

Learn about the Common JavaScript interface for Adobe Captivate

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Sep 02, 2016 Sep 02, 2016
LATEST

The syntax for an Input is "value", not innerHTML. You'll need to set a timeout to ensure the element is in the DOM first.

setTimeout(function()

    {    

     var myBox = document.getElementById("myTextBox_inputField").value = "Text from Javascript"; 

   

    }, 0200);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources