by Lori Smith
You have been asked to create a Text Entry Box within Captivate that requires the student to type an email address. If the student fails to type a properly formatted email address into the Text Entry Box, you would like Captivate to flag the email address as invalid.
So what are your options as a Captivate developer? You could use the Validate user input option available for any Text Entry Box. However, that won't work unless you know all of the possible email addresses that could be typed by students and include the addresses in the Correct entries area of the Text Entry Box tab.
This is a perfect opportunity to use Advanced Actions. While Advanced Actions can't guarantee that a perfect email address will be typed by the student, the Action can help at least avoid some of the most common mistakes people make when they type an email address (for instance, many people forget to type the @ when addressing an email) or they leave off the period just before the com or net.
During the next few steps, I'm going to show you how to create an Action that will ensure the email address typed by students contains the @ and the period.
First, create two Text Captions (they will be used as Success and Failure captions) via Insert > Standard Objects. Name the two Text Captions as follows: SuccessCaption and FailureCaption. When you create the Text Captions, be sure to make them invisible. (On the Options tab of each item, deselect Visible.)

Create a User Defined Variable (via Project > Actions > Variables) named emailAddr.
Create a Text Entry Box (via Insert > Standard Objects > Text Entry Box). On the Options tab, ensure the Text Entry Box includes a Button and Validate is not selected. On the Advanced tab, associate the emailAddr variable with the text.

Create an Advanced Action
Choose Project > Actions > Advanced actions and Create a new action (from the Edit/Create action drop-down menu) to create the action below:

Lastly, show the Properties of the Text Entry Box and set the On Success to Execute advanced action (select checkEmailAddr).

When students enter an email address in the Text Entry Box and click the button, the Action you created will check for the key characters of an email address. If either the @ or period are missing, the Failure caption you created will appear. Otherwise, students will see the Success caption.
As I mentioned in my last article (Actions In Action), if you have a cool idea or need for an action, please send it to me. I am in the process of developing a new course on Captivate Advanced Actions. If I use your idea in the course, you will be eligible to take the class for free!
About the author: Lori Smith is IconLogic's lead programmer and veteran Captivate developer. Lori holds a Bachelors degree from MIT and a Masters from George Mason University. She has been working in the field of software engineering for more than 20 years.
Worried about your class canceling? You'll be happy to hear that we never, ever cancel our classes (even if there's just one student registered).
Great stuff!
Am am using this technique to hide the submit button if the data is invalid and then reveal it if all data is good! this way I can guarantee that a user is subimtting the correct data…
One thing with the if statement above… if you have an @ sign and a . in the text input field it validates.. we need a way of if checking for a trailing tilde after the dot for it to be Valid for real!
Great stuff!
Am am using this technique to hide the submit button if the data is invalid and then reveal it if all data is good! this way I can guarantee that a user is subimtting the correct data…
One thing with the if statement above… if you have an @ sign and a . in the text input field it validates.. we need a way of if checking for a trailing tilde after the dot for it to be Valid for real!
Great stuff!
Am am using this technique to hide the submit button if the data is invalid and then reveal it if all data is good! this way I can guarantee that a user is subimtting the correct data…
One thing with the if statement above… if you have an @ sign and a . in the text input field it validates.. we need a way of if checking for a trailing tilde after the dot for it to be Valid for real!
You can certainly add an additional condition (double click on the at the end of the condition line and make it say AND (emailAddr contains ~)
The trouble is that there is no way of assuring order. If an a valid string is boo@foo.com~org is correct, but boo~.@com is not, they will both show as valid in this check. Just a head’s up….
— Lori
You can certainly add an additional condition (double click on the at the end of the condition line and make it say AND (emailAddr contains ~)
The trouble is that there is no way of assuring order. If an a valid string is boo@foo.com~org is correct, but boo~.@com is not, they will both show as valid in this check. Just a head’s up….
— Lori
You can certainly add an additional condition (double click on the at the end of the condition line and make it say AND (emailAddr contains ~)
The trouble is that there is no way of assuring order. If an a valid string is boo@foo.com~org is correct, but boo~.@com is not, they will both show as valid in this check. Just a head’s up….
— Lori