The <submit> element is used to submit information to the origin web server and then transition to the document sent back in the response. Unlike <goto>, it lets you submit a list of variables to the document server via an HTTP GET or POST request.
| fetchhint | This attribute is not supported. |
| fetchtimeout | (defaults to "fetchtimeout" global property value) The timeout for fetches. Must be specified with the appropriate time units (e.g., "120s" for 120 seconds). |
| maxage | (defaults to "documentmaxage" global property value) Tells the platform the maximum acceptable age, in seconds, of cached documents. |
| maxstale | (defaults to "documentmaxstale" global property value) Tells the platform the maximum acceptable staleness, in seconds, of expired cached documents. |
| next | The URI reference. |
| expr | Like next, except that the URI reference is dynamically determined by evaluating the given ECMAScript expression. |
| fetchaudio | (defaults to "fetchaudio" global property value) The URI of the audio clip to play while the fetch is being done. |
| method | (defaults to "get") The request method: get or post. |
| enctype | (defaults to "application/x-www-form-urlencoded") This attribute specifies the HTTP POST encoding format. The other permissible choice is "multipart/form-data" which is the encoding method used by the platform when binary data is being submitted. |
| namelist | The list of variables to submit. The default is to submit no variables. If a namelist is supplied, it may contain individual variable references that are submitted with the same qualification used in the namelist. Declared VoiceXML and ECMAScript variables can be referenced. |
Exactly one of "next" and "expr" must be specified.
<?xml version="1.0"?>
<vxml version="2.0">
<var name="myname" expr="'Jane Doe'"/>
<form>
<field name="drivelicense" type="digits">
<prompt>
<value expr="myname"/>,
Please say your driver's license number.
</prompt>
<filled>
You entered <value expr="drivelicense"/>.
<!-- Specifying the "method" attribute as "post" -->
<!-- otherwise it defaults to "get" which would put -->
<!-- variable values directly into the URL. -->
<submit next="http://nonexistent.domain.com/process.pl"
method="post" namelist="drivelicense myname"/>
</filled>
</field>
</form>
</vxml>The output of the above script would be:
Computer: Jane Doe. Please say your driver's license number.
Human: One two three four five six seven eight nine.
Computer: You entered one hundred twenty-three million, four hundred fifty-six thousand, seven hundred eighty-nine.
(submits information to http://nonexistent.domain.com/process.pl…)
None
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>