< submit >
Description
The <submit> element submits values to document server. It is similar to <goto> in that it results in a new document being obtained. Unlike <goto>, it lets you submit a list of variables to the document server via HTTP GET or HTTP POST.
Syntax
<submit next="URI" expr="ECMAScript_Expression" namelist="variable1 variable2 ..." method="get" | "post" enctype="MIME_type" fetchaudio="URI" fetchhint="prefetch" | "safe" fetchtimeout="time_interval" maxage="time_interval" maxstale="time_interval"> </submit>
Attributes
next | The next attribute is the URI to which the query is submitted. This attribute is required - specifically either next or expr is required. |
expr | The expr attribute is an expression that yields the URI. This attribute is required - specifically either next or expr is required. |
namelist | The namelist attribute is a space-separated list of variables to submit. This attribute is optional and defaults to nothing. |
method | The method attribute specifies the query request method, get or post. This attribute is optional and defaults to get. |
enctype | The enctype attribute is MIME encoding of the document. This attribute is optional and defaults to application/x-www-form-urlencoded. The following types are supported: * application/x-www-form-urlencoded. * multipart/form-data. |
fetchaudio | The fetchaudio attribute is the URI of the audio to play while waiting for the next document to be fetched. |
fetchhint | The fetchhint defines when the audio file should be retrieved. This attribute is optional. * prefetch – the audio file may be downloaded when the page is loaded. * safe – the audio file is loaded only when needed. |
maxage | The maxage attribute indicates the maximum time in seconds that this document will use this file before fetching another copy. This attribute is optional. |
maxstale | The maxstale attribute indicates the maximum time in seconds that this document will use a file that exceeded the maxage time. This attribute is optional. |
Parents
<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Extensions
None.
Limitations/Restrictions
The attribute fetchhint = prefetch is not supported, and is optional in VoiceXML.
Example Code
<?xml version="1.0"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"> <form id="get_from_and_to_cities"> <grammar src="from_to.grammar"/> <block> Welcome to the Driving Directions By Phone. </block> <initial name="bypass_init"> <prompt>Where do you want to drive from and to?</prompt> <nomatch count="1"> Please say something like this, "from Toronto Ontario to Ottawa Ontario". </nomatch> <nomatch count="2"> I'm sorry, I still don't understand. I'll ask you for information one piece at a time. <assign name="bypass_init" expr="true"/> <reprompt/> </nomatch> </initial> <field name="from_city"> <grammar src="city.grammar"/> <prompt>From which city are you leaving?</prompt> ... </field> <field name="to_city"> <grammar src="city.grammar"/> <prompt>Which city are you going to?</prompt> ... </field> <block> <prompt>Retrieving directions</prompt> <submit next="direction.cgi" method="post" namelist="from_city to_city"/> </block> </form> </vxml>