Last reviewed: 3/23/2024 12:39:36 PM
<submit>
A <submit> element sends values to a document server.
Syntax
<submit enctype="mediaencodingtype"
expr="expression"
fetchaudio="uri"
fetchhint="fetchtype"
fetchtimeout="secondsormilliseconds"
maxage="seconds"
maxstale="seconds"
method="methodtype"
namelist="var1 ..."
next="uri" />
Attributes
enctype
The media encoding type of the submitted document (when the value of method is "post"). The default is application/x-www-form-urlencoded. Interpreters may support additional encoding types.
Media Encoding Type | Description |
---|---|
application/x-www-form-urlencoded | See Form content types. |
multipart/form-data | See Form content types. |
expr
Like next, except that the URI reference is dynamically determined by evaluating the given ECMAScript expression.
fetchaudio
The URI of the audio clip to play while the fetch is being done. If not specified, the fetchaudio property is used, and if that property is not set, no audio is played during the fetch. The fetching of the audio clip is governed by the audiofetchhint, audiomaxage, audiomaxstale, and fetchtimeout properties in effect at the time of the fetch. The playing of the audio clip is governed by the fetchaudiodelay, and fetchaudiominimum properties in effect at the time of the fetch. The default value is the fetchaudio property.
fetchhint
Defines when the interpreter context should retrieve content from the server. If not specified, a value derived from the innermost relevant fetchhint property is used. The default value is the documentfetchhint property.
Fetch Type | Description |
---|---|
prefetch | Indicates a file may be downloaded when the page is loaded. |
safe | Indicates a file that should only be downloaded when actually needed. |
fetchtimeout
The interval to wait for the content to be returned before throwing an error.badfetch event. The value is a Time Designation. The default value is the fetchtimeout property.
maxage
Indicates that the document is willing to use content whose age is no greater than the specified time in seconds. The document is not willing to use stale content, unless maxstale is also provided. If not specified, a value derived from the innermost relevant maxage property, if present, is used. The default value is the documentmaxage property.
maxstale
Indicates that the document is willing to use content that has exceeded its expiration time. If maxstale is assigned a value, then the document is willing to accept content that has exceeded its expiration time by no more than the specified number of seconds. If not specified, a value derived from the innermost relevant maxstale property, if present, is used. The default value is the documentmaxstale property.
method
The request method type. The default value is get.
Method Type | Description |
---|---|
get | HTTP GET request |
post | HTTP POST request |
namelist
The list of variables to submit. By default, all the named input item variables are submitted. If a namelist is supplied, it may contain individual variable references which are submitted with the same qualification used in the namelist. Declared VoiceXML and ECMAScript variables can be referenced. If an undeclared variable is referenced in the namelist, then an error.semantic is thrown.
next
The URI reference.
Children
none
Parents
<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>, and <prompt>.
Variables
none
Example
The following example illustrates using submit.
<form>
<subdialog name="result" src="#getdriverslicense">
<param name="birthday" expr="'2000-02-10'"/>
<filled>
<submit next="http://myservice.example.com/cgi-bin/process"/>
</filled>
</subdialog>
</form>
<!-- subdialog to get drivers license -->
<form id="getdriverslicense">
<var name="birthday"/>
<field name="drivelicense">
<grammar src="http://grammarlib/drivegrammar.grxml"
type="application/srgs+xml"/>
<prompt> Please say your drivers license number. </prompt>
<filled>
<if cond="validdrivelicense(drivelicense,birthday)">
<var name="status" expr="true"/>
<else/>
<var name="status" expr="false"/>
</if>
<return namelist="drivelicense status"/>
</filled>
</field>
</form>
Version Information
Supported in: VoiceXML 1.0, VoiceXML 2.0, and VoiceXML 2.1.