digit length... 7 or 10 digits
Posted: Fri Feb 23, 2007 3:19 pm
I am trying to force people to only enter in 7 digits or 10 digits but this does not work: type="digits?length=10|7"
If there is no way to do it in the field tag is there a way I can run it through an if statement and check the length of what they entered?
something like this:
Problem with that is I don't know how to get the length of what they entered I am sure it is not enterNumber.length.
Can someone give me an option that will work?
If there is no way to do it in the field tag is there a way I can run it through an if statement and check the length of what they entered?
something like this:
Code: Select all
<property name="interdigittimeout" value="2s"/>
<field name="enterNumber" type="digits">
<prompt timeout="8s">
<audio expr="http://myfile.com/US2.1.mp3'">Please enter your cell phone number</audio>
</prompt>
<filled>
<if cond="enterNumber.length = 10">
<audio expr="http://myfile.com/US3_.mp3'">You have not entered a 7 or 10 digit number</audio>
<goto next="#getNumber" />
<elseif cond="enterNumber.length = 7"/>
<assign name="document.tempPhoneNumber" expr="enterNumber"/>
<goto next="#readmsisdn"/>
</if>
</filled>
Can someone give me an option that will work?