We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How do I reprompt all fields except the first?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

How do I reprompt all fields except the first?

Post by soso »

Hi,

I've a form wich are 5 fields.

When the user input the star pound, I must reset and reprompt the 4 fields except the first. I must to save a value of the first field (phone number).

I try this code but it doesn't work:

Code: Select all

<form id="main">

<field name="phone">

</field>

<field name="field1">

</field>

<field name="field2">

</field>

<field name="field3">

<filled>
<if cond="field3='*'">

<assign name="field2" expr="undefined" />
<assign name="field3" expr="undefined" />

<reprompt />

</if>
</filled>

</field>

</form>
Can you help me?

Thanks by advance.

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

IVR code example for reprompt <field>s

Post by support »

Hi,

Here is an IVR code example for reprompt <field>s that should help you implement this:

repromptfields.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

  <var name="phonenum"/>

  <form id="collect_phone">
    <field name="phone_field" type="digits?length=10">
      <prompt> please enter your phone number </prompt>
      <filled>
        <assign name="phonenum" expr="phone_field"/>
        <goto next="#collect_other"/>
      </filled>
    </field>
  </form>

  <form id="collect_other">
    <!-- this link resets all the fields in the #collect_other form -->
    <link dtmf="*" next="#collect_other"/>

    <field name="field2" type="digits">
      <prompt>Please enter your age.</prompt>
    </field>
    <field name="field3" type="digits">
      <prompt>Please enter your favorite number.</prompt>
    </field>
    <field name="field4" type="digits">
      <prompt>Please enter your number of pets.</prompt>
    </field>
    <field name="field5" type="digits">
      <prompt>Please enter the number of people in your household.</prompt>
    </field>
    <filled>
      <!-- use the global var "phone" and the local fields to submit elsewhere -->
      <submit next="http://nonexistent.domain.com/process.pl" method="post" namelist="phonenum field2 field3 field4 field5"/>
    </filled>
  </form>

</vxml>
Hope this helps.

Regards,
Plum Support

Post Reply