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

Appropriate time to use <submit>

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jallard
Posts: 21
Joined: Mon Oct 03, 2011 7:20 am

Appropriate time to use <submit>

Post by jallard »

I wanted to know if i have to submit a web service call after each user input that I want captured, or if it was possible for me to wait until all data has been collected before I use the <submit> tag? If so, how do I insure all the correct data is collected? Is this done in the background?

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

Re: Appropriate time to use <submit>

Post by support »

Hi jallard,

No, it is possible to collect all of the information before you submit it to your backend. We recommend using a root document that contains all of the variables you would like to submit. As you collect the data from the users, you can store the final values into those variables. Once you have collected all of the information, you then send the data.

root.php

Code: Select all

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

<vxml version="2.0">
  <!-- Variables  -->
  <var name="seq"/>
  <var name="date"/>
  <var name="routing"/>
</vxml>
main.php

Code: Select all

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

<vxml version="2.0" application="root.php">
  <form id="Sequence">
    <field name="chkseq" type="digits?length=6">
      <prompt>
	Please enter the check sequence number located on the check.
      </prompt>
      <filled>
	<assign name="seq" expr="chkseq"/>
	<goto next="#get_date"/>
      </filled>
    </field>
  </form>
After you've collected all of the information necessary and stored this information into the variables declared in your root document, you would submit these values.

main.php

Code: Select all

  <form id="submit_data">
    <block>
      <submit next="http://www.example.com/ivr/submit.php" namelist="seq date routing"/>
    </block>
  </form>
</vxml>
Regards,
Plum Support

jallard
Posts: 21
Joined: Mon Oct 03, 2011 7:20 am

Re: Appropriate time to use <submit>

Post by jallard »

Thank you so much for your help. Troy was right, you guys are great.

Post Reply