<submit>

Submits values to a document server. The <submit> element is used to submit information to the origin web server and then transition to the document sent back in the response.

Syntax

 <submit
     next="URI"
     expr="js_expression"
     method="get"|"post"
     enctype=MIME_type
     namelist="variable1 ..."
     fetchtimeout="time_interval"
     fetchaudio="URI"
     maxage="time_interval" 
     maxstale="time_interval"
 />

Description

Attribute Description
next

URI to which to submit the values. Optional (as alternative to expr).

expr

JavaScript expression that evaluates to the URI to which to submit the values. Optional (as alternative to next).

method

The query request method. Optional (default is get).

enctype

MIME encoding of the submitted document. Optional (default is application/x-www-form-urlencoded).

The supported types are:

application/x-www-form-urlencoded
multipart/form-data

The type multipart/form-data is more efficient when submitting large amounts of binary data.

namelist

Space-separated list of variables to submit. Optional (default is to submit all input variables that have been given explicit names with the name attribute of <field>, <record>, <transfer>, or <subdialog>).

This attribute can specify any variable currently in scope, both VoiceXML variables and JavaScript variables, including shadow variables and other variables that have not been explicitly declared.

A variable set to a JavaScript object is submitted as the individual component values; see Submitting Complex JavaScript Objects.

fetchtimeout

Specifies the interval to wait for the resource to be returned before throwing a error.badfetch event. See Handling Fetching Delays. Optional.

fetchaudio

Specifies the URI of background audio to be played during fetching. Note that this attribute and related properties affect whether queued prompts are played first. See Background Audio for important details. Optional.

maxage

New in VoiceXML 2.0. Specifies the maximum acceptable age, in seconds, of the cached resource. See Maximum Age. Optional.

maxstale

New in VoiceXML 2.0. Specifies the maximum acceptable time, in seconds, during which an expired cached resource can still be used. See Maximum Stale Time. Optional.

(VoiceXML 1.0 only) The following attributes can be used in applications in which the version attribute of the <vxml> tag is set to 1.0.

Attribute Description
caching

VoiceXML 1.0 only. Specifies the caching policy for the resource being fetched. See Fetch Hints. Optional.

Used in place of the VoiceXML 2.0 attributes maxage and maxstale.

Tip:

 •  If a JavaScript expression contains any of the characters "<", ">", or "&", that character must be replaced with the corresponding escape sequence "&lt;", "&gt;", or "&amp;". For more information, see JavaScript Quick Reference.

Usage

Parents Children
<bevocal:foreach>
<block>
<catch>
<error>
<filled>
<help>
<if>
<noinput>
<nomatch>

None.

See Also

 •  VoiceXML 2.0 Specification: <submit>
 •  Related tags: <goto>, <send>

Examples

 <?xml version="1.0" ?>
 <!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
  "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
 
 <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
   <form id="form-record">
     <field name="name" type="boolean">
       <prompt>
         Say yes or no to submit a request to Snoop Servlet
       </prompt>
       <filled>
         <if cond="name">
           <submit maxage="0" method="post"
             next="http://www.yoursite.com:8080/docroot/SomeServlet"/> 
         <else/>
           <prompt> Good bye! </prompt>
           <exit/>
         </if>
       </filled>
     </field>
   </form>
 </vxml>

[Show Frames]   [FIRST] [PREVIOUS] [NEXT]
BeVocal, Inc. Café Home | Developer Agreement | Privacy Policy | Site Map | Terms & Conditions
Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL