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 is the maxlength for <field> attribute type=numbe

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
amepay
Posts: 1
Joined: Fri Jul 30, 2004 10:10 am

What is the maxlength for <field> attribute type=numbe

Post 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.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR code for collection of fixed length set of digits

Post 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

Post Reply