Highlighted

Show submit button after text is entered

New Here ,
Apr 25, 2020

Copy link to clipboard

Copied

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?

Views

99

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Show submit button after text is entered

New Here ,
Apr 25, 2020

Copy link to clipboard

Copied

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?

Views

100

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 25, 2020 0
Most Valuable Participant ,
Apr 26, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 26, 2020 0
Adobe Community Professional ,
Apr 26, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 26, 2020 0
New Here ,
Apr 28, 2020

Copy link to clipboard

Copied

How would you do the javascript?  

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 28, 2020 0
Most Valuable Participant ,
Apr 29, 2020

Copy link to clipboard

Copied

Why make it easy when it can be complicated... Are you a programmer with experience in JS?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 29, 2020 0
New Here ,
Apr 29, 2020

Copy link to clipboard

Copied

LOL-- Complicated is fun?  
I tried the widget, and it didn't seem to work right.  Maybe I did something wrong.

 

No, not a programer, but I do have a little experience with JS, and I have an programmer sitting next to me who can help.  

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 29, 2020 0
Most Valuable Participant ,
Apr 29, 2020

Copy link to clipboard

Copied

I like challenges as well. Was also talking about what I proposed as solution, which IMO is more user friendly. You want to block the learner on the slide until something is entered, I propose to give a warning when Submit is clicked and allow the learner to enter something...new attempt.

CpExtra is a wonderful widget, but needs some learning time.

You can always go ahead with JS, hope you'll get some code from the many JS experts around. I only iuse it when the shared/advanced actions are incapable of doing what I want. Had to program to much in my previous careers, dislike the debugging phase.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 29, 2020 0
New Here ,
Apr 29, 2020

Copy link to clipboard

Copied

Thanks.  I will try the widget again.  I just didn't think it was going to solve my problem, and thought JS was the only way to go.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 29, 2020 0
Lilybiri LATEST
Most Valuable Participant ,
Apr 29, 2020

Copy link to clipboard

Copied

Did you at least read my blog, where I propose an Advanced Action solution. It seems you did not even see the very first answer I offered. It a blog which has been posted in a first version at least 8 years ago, and is still visited although I recently created a new version, for HTML output. 

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 29, 2020 0