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?
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.
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
Copy link to clipboard
Copied
How would you do the javascript?
Copy link to clipboard
Copied
Why make it easy when it can be complicated... Are you a programmer with experience in JS?
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.
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.
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.
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.