• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Set up a text entry box to not accept a null value

Community Beginner ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

Hi

 

I'm using Captivate 2019, I want to set a text entry box to force a user to enter their name and if they omit this, then a message box to display stating that their name must be entered before they can continue. I have set up my text entry box and trxt caption box to display the message but I've been unable to get this to work.

 

I have seen a guide to how to do this but I think it is old and some of the advanced actions look different in my version. I did manage some of it in adding an advanced action of creating if v_name is equal to v_null and Show NameIncorrect. The guide then goes to adding an expression and this is where I get stuck. The example shows rdcmdGoToFrame = rdinfoCurrentFrame - 1. I can't see rdcmdGoToFrame or rdinfoCurrentFrame in the drop down lists. Can anyone advise me please?

 

Thanks in advance

Guy

Views

1.1K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 27, 2019 Oct 27, 2019

Have a look at this blog post, where I explain in detail exactly this use case:

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

 

No Javascript needed, just some simple advanced actions. All is based on comparing the variable associated with the TEB to an empty variable which I indicate as v_nullo. I refurbished an olde blog of 8 years ago for HTML output. That old post was still very well visited, hence....

Votes

Translate

Translate
Community Expert ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

Have a look at this blog post, where I explain in detail exactly this use case:

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

 

No Javascript needed, just some simple advanced actions. All is based on comparing the variable associated with the TEB to an empty variable which I indicate as v_nullo. I refurbished an olde blog of 8 years ago for HTML output. That old post was still very well visited, hence....

Votes

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
community guidelines
Community Beginner ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

Thanks but I'm very new to all of this! I still don't understand what I need to do, I've attached an image of how far I got, could you possibly spell out what I need to add next?Captivate.JPG

Votes

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
community guidelines
Advisor ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

Are EntryData  and  Empty  the names of variables that you created?

Or are you using the names you assigned  and choosing literal in the advanced action window?

 

Did you assign the text entry box to use the EntryData variable?

Votes

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
community guidelines
Community Beginner ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

Yes EntryData and Empty are the names of the variables. The advanced action does work in that if no name is entered the text caption is displayed to tell the user to enter their name. When the name is entered nothing happens when the submit buttion is clicked. Do I need to add furtheradvanced actions?

Votes

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
community guidelines
Advisor ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

Did you add an ELSE action for when the advanced action is false?

Votes

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
community guidelines
Community Beginner ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

No I didn't enter an ESLE, hadn't spotted that, I'll try that and let you know. I had a go with the JavaScript method and did get an error as you suggested. I rentered the " marks, which got rid of the eror but it didn't trigger the error message if the name was omitted. Should this work with .swf and HTML5?

Votes

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
community guidelines
Advisor ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

The names of your objects are case sensitive so if yours is named Error (uppercase E) - that means error (lowercase E) would not work. The ELSE tab should be way to the bottom.

It will work with HTML5 just fine but I would not waste my time with SWF at this point.

 

else.jpg

Votes

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
community guidelines
Community Beginner ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

OK I found the ELSE and entered that, I've atached an image from a guide I was following, the issue I have now seems to be where the guide shows an Expression needs to be entered, I am seening a yellow triangle with exclamation mark and not seeing the green tick as with the other actions. Any idea what I have done wrong?Cap Error.JPG

Votes

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
community guidelines
Community Expert ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

Yoi seem to prefer JavaScript, and didn't really follow my blog post. It is important to label everything in a correct way, because Captivate doesn't support having the same label used for two totally different items.

 

You defined two variables, I start them with v_ to identify them as variables.

What you cal 'EntryData' should be the variable associated with the Text Entry Box, which is NOT validated.

What you call 'Empty' is the null variable.

 

Erro should be the text container with the warning message, which is initially hidden.

 

Will leave you to the HS expert, but don't forget that for a newbie advanced actions are much easier to understand and use, lot less debugging needed.

 

Here is a link to a basic blog about Text Entry Boxes:

http://blog.lilybiri.com/text-entry-boxes-back-to-basics

Votes

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
community guidelines
Community Beginner ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

In your blog you have set up an Expression, this looks like what I have wrong as I am seeing the yellow triangle with exclamation mark and not the green tick. What do I need to enter for the expression to work?

Votes

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
community guidelines
Community Beginner ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

I've got it all working now! Thank you for your time.

Votes

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
community guidelines
Community Expert ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

Sorry, but I live in a totally different time zone and was sleeping.

When you see a yellow triangle, it means that the command on that line is missing something, is not finished: can be a parameter which has not be defined or is waiting for confirmation.

Expression is a specific command which you only find in advanced and shared actions. It has only the four basic mathematic parameters but can very useful, especially for micro-navigation as is here the case.

 

There is a lot to be learned about Advanced/Shared actions on my blog. But when I quit this forum at midnight yesterday, I was under the impression that you wanted to use the JS solution by Greg? Sorry for the confusion.

Votes

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
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

No problem Lilibiri, I later realised that I didn't need an Expression for what I needed to do so I left it out and it now works! I totally appreciate that there is a lot to learn about Advamced/Shared actions  so I will keep looking at your blogs. I was also just trying out the JS solution as an alternative. Thank you very much for your advice.

Votes

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
community guidelines
Community Expert ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

I am astonished that you didn't need the Expression command. Do you want to allow a second attempt after the error message appeared because the TEB remained empty? Since it is a non-validated TEB that is only possible if you re-enter the slide. That was the reason I posted a link to that blog about Basics for TEBs. 

Votes

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
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

I've attached an image of how I've set it up. If the name is omitted from the TEB, the error message is displayed. It then allows the user to follow the instruction and enter their name, click the Submit button and move to the next slide which is what I need! Does it seem odd that this works?

 

Captivate2.JPG

Votes

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
community guidelines
Community Expert ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

OK, see that you use the 'old' workflow, to replay the slide. with the Assign command, but you made it rather complicated. There is a system variable which stores the present slide number: cpInfoCurrentSlide. Because that is a variables starting with 1, and cpCmndGotSlide starts with 0, you should have used an Expression as well:

Expression  cpCmndGotoSlide is equal to cpInfoCurrentSlide - 1

 

That worked fine for SWF output, but did you really test it for HTML5 output? This means that if you use a npon-responsive project you need to test it with F11, Preview HTML in Browser. You may discover that it is NOT working for HTML output, at least it didn't for several versions. It looks to me that you did use the very old post I created for 'Where is Null', but that one was only for SWF output, HTML5 output didn't exist at that moment.

Votes

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
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

I publihed to .swf, you are right though about HTML5. I tried Publishing in that format, the error message is displayed if the name is omitted but the submit button doesn't work to go to the next slide. I'll try setting it up like you suggest and then publish to HTML5. I'll let you know how I get on. Thank you.

Votes

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
community guidelines
Community Expert ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

I would not publish to SWF anymore, since the end of Flash Player by all browsers is so near....

Votes

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
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

Yes I had heard that, I'll give it a try in HTML5.

Votes

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
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

I have attached an image of how I have tried to set it up with an Assign and Expression for publishing in HTML5. When I try this the error message is displayed if the name is omitted but when the name is entered and the submit button clicked it does not move on to the next slide. Have I misunderstood how to set this up?

 

Captivate html5.JPG

Votes

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
community guidelines
Community Expert ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

You completely misunderstood.  For HTML5 output you need to re-enter the slide, which is not happening with this command. You need to use the mcro-navigation approach I described in the blog, not the old on e but the new one for which I offered you a link to start with.

Moreover, if this was SWF output, you only need the Expression command, the Assign makes no sense at all. Can you please download the explanatory table about system variables from this post:

http://blog.lilybiri.com/discover-slash-use-captivates-system-variables-part-1

Votes

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
community guidelines
Community Beginner ,
Oct 29, 2019 Oct 29, 2019

Copy link to clipboard

Copied

OK thanks, I'll take a look at your post on system variables. I did also try the Java Script method  that Stagprime provided and that worked in HTML5 format but not in .swf. So I now have one method that works in .swf and another that works in HTML5! I kind of understand what the JS code is doing and I .really don't mind using either method. I won't be publishing in .swf format fr too much longer so may have to go with the JS method if I can't fathom out how to do it with variables. Thanks for your time and patience! 

Votes

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
community guidelines
Community Expert ,
Oct 29, 2019 Oct 29, 2019

Copy link to clipboard

Copied

Of course, that is the easiest way at this moment, because you are very new to Captivate.  Do not spend time on SWF output anymore and keep with the JS solution. Did you test if the learner can re-try to put data in the TEB?

Votes

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
community guidelines
Advisor ,
Oct 29, 2019 Oct 29, 2019

Copy link to clipboard

Copied

Glad to hear you got it to work. If you are interested in learning more about how to use JavaScript in Captivate - please check out this post.

Getting Started With JavaScript and Adobe Captivate 

 

I would echo the advice to move away from SWF.

The reattempts should work fine. In my example, I have the else action as going to the next slide so there needs to be a next slide to go to, of course.

The JavaScript doesn't care about the TEB - it behaves based upon the value of the variable.

Sometimes the best way to learn is through exposure and having your feet to the fire so to speak. When I started using JavaScript instead of advanced actions it was because advanced actions were not able to solve my problem. JavaScript not only solved the problem but I realized how much simpler it could be.

 

I believe that code, if written well, can be very easy to follow.
I have also said before that my ultimate goal is for people to learn and understand as well - rather than just copy paste all the time - but original motivation needs to come from somewhere. Little snippets like this can help provide not only the answers but also the motivation.

Votes

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
community guidelines
Resources
Help resources