cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
509
Views
0
Helpful
2
Replies

CVP - Create a custom DigitWithConfirm element that validate user input

vincent.zheng
Level 4
Level 4

I am using CallStudio 10.5

I need to implement an DigitWithCofirm element such that validate user input,

Consider following two scenario :

- DigitWithConfirm element is used to capture the date that enter by user by 4 digits (Just like the expired day of the credit card), if user input invalid date like 1300, the program will just crush. But I want the behavior is go back to ask the user input again.

- If using the regular DigitWithConfirm, after user input the valid date, and then he/she realize the date he/she enter is wrong, after he/she hear the confirm audio, instead to press 1 to confirm, he/she want to input other key to go back to re enter the date.

How I can achieve this task?

Thank you in advance

1 Accepted Solution

Accepted Solutions

janinegraves
Spotlight
Spotlight

The DigitWithConfirm is really just a Digits and a YesNoMenu element

combined into one element.

You can create the same functionality yourself by using a Digit element

to collect the date.

Then connect it to a YesNoMenu element where you confirm it using Say it

Smart (say it smart throws a Java exception if the date is not valid).

So in the Events tab of the YesNoMenu element, add an EventHandler path

to catch the Java Exception java.lang.Exception (case sensitive, no

blank spaces allowed!). That path means the date wasn't valid.

You can use a Counter element and a Decision element if you want to

limit the times the caller can press 2 (dis-confirm) or the number of

times they enter an in-valid date.

View solution in original post

2 Replies 2

janinegraves
Spotlight
Spotlight

The DigitWithConfirm is really just a Digits and a YesNoMenu element

combined into one element.

You can create the same functionality yourself by using a Digit element

to collect the date.

Then connect it to a YesNoMenu element where you confirm it using Say it

Smart (say it smart throws a Java exception if the date is not valid).

So in the Events tab of the YesNoMenu element, add an EventHandler path

to catch the Java Exception java.lang.Exception (case sensitive, no

blank spaces allowed!). That path means the date wasn't valid.

You can use a Counter element and a Decision element if you want to

limit the times the caller can press 2 (dis-confirm) or the number of

times they enter an in-valid date.

vincent.zheng
Level 4
Level 4

Thanks for the answer above