Skip to main content
Participating Frequently
October 17, 2019
Question

Initialize text entry box

  • October 17, 2019
  • 4 replies
  • 439 views

using google translation

 

I want to place a button that can reset the contents entered in the text entry box.

Can you create such a feature without using java?
If you need to use java please tell me how to do it.

 

best regards

    This topic has been closed for replies.

    4 replies

    Participating Frequently
    November 19, 2019

    Sorry for the late reply.

    After asking a question, I was slightly out of charge for this case and the answer was delayed.

    Thank you for all your answers.
    I saw everything, but I used ChrisMayAtDelta's method.

    Thanks to all who gave answers

    Lilybiri
    Legend
    November 19, 2019

    Did it clear the input while remaining on the same slide? It didn't for me, as I wrote although it is clearing the associated variable.

    Participating Frequently
    November 19, 2019

    Prepare text input box (variable name: input_box)
    Place the button and select Run JavaScript to set the following content
    document.getElementById ("input_box_inputField"). value = "";

    I could clear the entered characters without moving the slide by the method of ↑.

     

    I ’m using google translation, so I ’m sorry if there ’s something hard to read ...

    chrismay_at_delta17095116
    Inspiring
    October 17, 2019

    It is pretty easy. Assuming you are publishing for HTML5.

     

    Also assume your text entry box is named "myBox" in the properties window.

     

    1. On your button's actions, select "Execute Javascript"
    2. In the script window enter: document.getElementById("myBox_inputField").value="";
    3. Make sure the "Continue Playing the Project" check box is unchecked.

     

    Anytine the button is clicked, the text input field is cleared.

    Simply change the myBox part of myBox_inputField to the name of your text entry box.

    Lilybiri
    Legend
    October 18, 2019
    Maybe I misunderstand the question, because the JS (which result in same result as 'Assign v_TEB with v_null' in an advanced act) wil NOT reset what is shown in the TEB at all. That is why I pointed to re-entering the slide, or to use CpExtra. Clearing the variables doesn't result in showing an empty TEB! That is an old pain, has always been the case.
    chrismay_at_delta17095116
    Inspiring
    October 18, 2019

    Lieve, 

     

    This does work, the script is clearing the contents of the actual HTML input field, not the Captivate variable. This works fine as long as the submit button has not been pressed. After the submit button has been pressed, you cannot submit a second time. That might be what you are referring to. It is not clear if the original poster wanted to clear the text entry field before or after submitting... I assumed before since, as you pointed out,  you cannot submit again without leaving the slide and coming back...

     

    Lilybiri
    Legend
    October 17, 2019

    I would have suggested CpExtra by InfoSemantics as well. Easiest solution!

    There is an alternative without JavaScript (Java is a totally different programming language). It is re-entering the slide after clearing the associated variable. I have described that workflow in this blog post:

    http://blog.lilybiri.com/timeline-advanced-workflows

    Or you can watch this presentation:

    Captivate's Timeline

    RodWard
    Community Expert
    Community Expert
    October 17, 2019

    I would suggest you take a look at the information on this page about the CpExtra HTML5 widget:

    http://www.infosemantics.com.au/adobe-captivate-widgets/cpextra/help/preference-variables/teb-behavior

    Scroll to near the bottom of the page and you will find a section entitled: 

    xprefTEBUpdateFromVariable

    The HELP file explains what is required, but you need to be aware that this widget is not free.  It has dozens of functions to enhance HTML5 content in Adobe Captivate, as explained in the HELP section on this website.

     

    It is programmed in JavaScript, but does not require that you know how to program in JavaScript in order to take advantage of its functionality.