I'm working on a field that allows 9 digits or 11 digits,
Below is the code I tried but didn't work.
<field name="sth" type="digits">
<grammar type="application/x-regexp">{9}|{11}</grammar>
Thanks.
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
what if a field allows multiple lengths of digits?
link to builtin IVR grammars
The easiest way to do this is to add parameters to your builtin IVR grammar.
When you specify the field "type" attribute you are loading the builtin IVR grammar "digits". More info on builtin IVR grammars can be found here:
http://www.w3.org/TR/voicexml20/#dmlABuiltins
Hope this helps
The Plum Support Team
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="sth" type="digits?minlength=9;maxlength=11">
<prompt>Please enter some digits</prompt>
<filled>
You entered <value expr="sth"/>
</filled>
</field>
</form>
http://www.w3.org/TR/voicexml20/#dmlABuiltins
Hope this helps
The Plum Support Team
Last edited by support on Thu Feb 25, 2010 4:18 pm, edited 2 times in total.
IVR built-in grammar lengths
In the case of 9 digits or 11 digits you can simply reference the builtin IVR grammars with lengths individually:
This IVR code resticts the input to either 9 or 11 digits.
Hope This Helps!
The Plum Support Team
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="sth">
<prompt>Please enter some digits</prompt>
<grammar src="builtin:dtmf/digits?length=9"/>
<grammar src="builtin:dtmf/digits?length=11"/>
<filled>
You entered <value expr="sth"/>
</filled>
</field>
</form>
</vxml>
Hope This Helps!
The Plum Support Team