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

verifying a field on a form

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
neilstebbing
Posts: 23
Joined: Mon Jun 28, 2010 1:24 pm

verifying a field on a form

Post by neilstebbing »

I was trying to verify a field all on the one form. So i wanted the user to enter/say Field1 and then i wanted to repeat the value of field1 back to the user and get them to verify by e.g. 1 to continue of * to reenter (reprompt)...So i am having trouble doing this all on the one form. So it seems i will have to do this on multiple forms but this does not seem good design. Can i do this on one form or is multiple forms my only option? :D

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

Re: verifying a field on a form

Post by support »

Hi Neil,

You can actually do this all in one form. The following is a short example of how you would accomplish this using only a single form:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
  <form id="start">
    <field name="myfield" type="digits?length=1">
      <prompt>
        Say or enter a digit.
      </prompt>
      <filled>
        You entered <value expr="myfield"/>.
      </filled>
    </field>
    <field name="confirm">
      <grammar type="application/x-jsgf" mode="dtmf">
        ( 1 | 2 )+
      </grammar>
      <prompt>
        Is this correct? Press 1 for yes or 2 for no.
      </prompt>
      <filled>
        <if cond="confirm==1">
          <prompt>
            Ok. All done.
          </prompt>
        <else/>
          <goto next="#start"/>
        </if>
      </filled>
    </field>
  </form>
</vxml>
Regards,
Plum Support

IanM
Posts: 2
Joined: Mon Aug 01, 2011 12:38 am

Re: verifying a field on a form

Post by IanM »

Just wanted to say thanks @support, this helped me as well. This answer came up right away on the forum search.

Post Reply