Copy link to clipboard
Copied
Hi I'm new to captivate 9. What's the best way to validate a TEB for an email address. I've used an advanced action to look for the string that contains @, .com etc. For an invalid entry I've used ELSE to display a text message. I need this text message and the submit button to to disappear when a valid email format is entered. Open to any suggestions
Copy link to clipboard
Copied
I would do this with three similar but unique slides. On slide 1, I would have my TEB but I would turn off the built in submit button and create my own to run an advanced action. I would only validate that the text entry box contains a @and a dot (.). At present, there are so many possible email extensions that this could be a seemingly endless list to validate against.
If (Text_Entry_Box_1 contains @ &&
Text_Entry_Box_1 contains . )
Jump to slide 3 Slide 3
Else
Jump to slide 2 slide 2
Slide 3 would continue with the rest of the project. Slide 2 would have a message suggesting that the email was not in the correct format and provide a try again button that would return you to the first page to try again.
Copy link to clipboard
Copied
You don't validate the entry itself, just the presence of @ or another sequence of characters containing é? And you want the user to remain on the slide until valid address is stored in the associated variable? Issue is that if the user clicks on Submit, to offer a new chance you have to rewind the playhead a couple of frames to have it again in the active part of the TEB. A non-scored TEB only has a Success event to trigger the action:
IF v_email contains @
Hide Gr_Tx (this group has both Success and Failure text)
Show Tx_Success
.... I don't know what has to happen
ELSE
Expression cpCmndGotoFrameAndResume = cpInfoCurrentFrame - 3
Show Tx_Failure (not necessary to hide group, unless you preview to enable revisiting the slide)
You can use the Submit button or a shortcut key for that button to trigger this action (Success event).No need for another button.
Principle of micronavigation: Micro-Navigation in Adobe Captivate - Captivate blog
I find it often much easier, since there is no score attached to the TEB (no validation on correct answer) to use the Scrolling Text Interaction. Since that is a static widget you don't have the problems with micronavigation (rewinding playhead). Using more slides is maybe easier, however it will increase the file size and you'll have to be careful with navigation, whether with a default playbar or with custom navigation buttons.
Here is an example of what can be done with the Scrolling Text Interaction, which is of course a lot more complicated than what you need: