No Match - Not only Comparing length but also input value
Posted: Tue Mar 15, 2016 12:35 pm
Hello Support,
I am trying to do something which i achieved but trying to understand if that can be done smartly.
For e.g, in one of my form i am asking user to input Number of Years for renewal of insurance and it can be between 1-5 years only,
So, i am putting <field name="myfield" type="digits?length=1"> like this, and if user enters anything more than one digit then its throwing error which is understood because it is matching length.
But for between 1-5 years i have to write if condition to compare the input from a fixed value. and if the "myfield" is not between 1-5 i have to throw error and also i have to limit the retires on wrong number of inputs to 3 times. Length was handled by no match, if wrong single digit input can be handled in no match also, that would be great.
Is there anyway i can put the condition for inserting digit only bewteen 1-5 in this node itself -
<field name="myfield" type="digits?length=1">
that way i can save lot of code for No match no input and comparison. Reason why, i have same kind of logic to applied in many places in this VXML.
Please guide if that is possible or any other smart way to handle this.
Thank You so much.
I am trying to do something which i achieved but trying to understand if that can be done smartly.
For e.g, in one of my form i am asking user to input Number of Years for renewal of insurance and it can be between 1-5 years only,
So, i am putting <field name="myfield" type="digits?length=1"> like this, and if user enters anything more than one digit then its throwing error which is understood because it is matching length.
But for between 1-5 years i have to write if condition to compare the input from a fixed value. and if the "myfield" is not between 1-5 i have to throw error and also i have to limit the retires on wrong number of inputs to 3 times. Length was handled by no match, if wrong single digit input can be handled in no match also, that would be great.
Is there anyway i can put the condition for inserting digit only bewteen 1-5 in this node itself -
<field name="myfield" type="digits?length=1">
that way i can save lot of code for No match no input and comparison. Reason why, i have same kind of logic to applied in many places in this VXML.
Please guide if that is possible or any other smart way to handle this.
Thank You so much.