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?
You will need to set up an advanced action. I have a blog post explaining how to do so:
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.
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.
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:
Why make it easy when it can be complicated... Are you a programmer with experience in JS?
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.
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.
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.
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.