Page 1 of 1
What is the maxlength for <field> attribute type=numbe
Posted: Thu Feb 03, 2005 11:33 am
by amepay
Hi
What is the maxlength for <field> attribute type=number?
Here's the behavior we are experiencing :
I've following field tag :
<field name="siteid" type="number">
If userinput length is 6 or less everything is fine.
Ex.: 999999
In case the userinput length exceeds 6 nomatch event gets triggered, Is this the expected behavior?
Moreover I would like to use type=number.
Please advice.
IVR code for collection of fixed length set of digits
Posted: Thu Feb 03, 2005 12:10 pm
by support
Hello,
Most
builtin IVR grammars support arguments, in the case of numbers you can set the follow:
Code: Select all
Parameter Description
minallowed Minimum number (default 0)
maxallowed Maximum number (default 999,999).
maxdecimal Maximum number of decimal places (default 2, maximum 9)
minexpected Minimum likely number (default 0)
maxexpected Maximum likely number (default 999)
These would be used as follows:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="siteid" type="number?maxallowed=999999999;maxdecimal=4">
<prompt>Please enter your site I D</prompt>
<filled>You entered <value expr="siteid"/></filled>
</field>
</form>
</vxml>
The parameters should be adjusted to suit your needs. However, given your example of 6 digits it is unclear what you are trying to accomplish. For collecting general input from user (such as a User ID or PIN code) you should be using the builtin IVR grammar "digits". The number grammar is designed for collecting floating point numbers such as 123.4 etc. The recommendation VoiceXML for collecting a fixed legth set of digits is as follows:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="siteid" type="digits?length=8">
<prompt>Please enter your site I D</prompt>
<filled>You entered <value expr="siteid"/></filled>
</field>
</form>
</vxml>
Hope This Helps!
Plum Support