Skip to main content
audras18251819
Participating Frequently
April 26, 2020
Question

Show submit button after text is entered

  • April 26, 2020
  • 1 reply
  • 497 views

I want to force the user to enter their name.  I have already set up everything up including the variable for username.  What I want is for the submit button to be shown only if text is entered in the text entry box.  Currently they can leave the box empty and click submit.  This throws the rest of the video off as there are now weird spaces and seemingly random " 's " floating because a name was not entered.  

 

Is this possible?

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    April 26, 2020

    You will need to set up an advanced action. I have a blog post explaining how to do so:

    http://blog.lilybiri.com/where-is-null-in-cp2017

    Solution will not hide/disable the Submit button, but show a warning and the user will not be able to proceed until an meaningful text has been entered.

    RodWard
    Community Expert
    Community Expert
    April 26, 2020

    I think the problem here may be that the user wants the Submit button hidden until the learner has at least entered something into the TEB field.   You cannot hide the defau't Submit button that is added to a Text Entry Box.

     

    However, since text entered into the TEB is always immediately written to its related User Variable you can remove the TEB's default Submit button and add other Submit button (e.g. Smart Shape button) with a hidden state that is selectec by default.  The problem here is that Captivate doesn't have any default way to execute a Conditional Advanced Action when it detects a change to the value of a variable.  You would normally need to resort to JavaScript to pull that off.

     

    Another way to trigger the state change to make the hidden button visible again would be to use the CpExtra HTML5 widget.  It has the ability to detect a variable value change and then trigger a change to an Object State.  You can see that described lower down on this Help page:
    http://www.infosemantics.com.au/adobe-captivate-widgets/cpextra/help/object-states

    audras18251819
    Participating Frequently
    April 29, 2020

    How would you do the javascript?