xforms:submission

Purpose

Defines the information to submit, where it should be sent, and how to send it.

A single instance may appear in the form's model element. It can be associated with different xforms:submit elements, using the attributes on the contained xforms:setvalue element.

Note:

A form and submitted data should always be processed by the same MCS instance.

Contained by

Attributes

Attribute Description Type Default Options Use
action The URI to which the form data will be submitted for processing. xs:anyURI none    optional 
method The HTTP method by which the form will be submitted. xs:string none  get, post  optional 

Attribute groups

Examples

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:si="http://www.volantis.com/xmlns/2006/01/xdime2/si"
  xmlns:xforms="http://www.w3.org/2002/xforms">
  <head>
    <title>Subscriber update</title>
    <xforms:model id="address">
      <xforms:instance>
        <si:instance>
          <si:item name="name"/>
          <si:item name="postcode">13004 Marseille</si:item>
          <si:item name="hidden">subscriber_id</si:item>
        </si:instance>
      </xforms:instance>
      <xforms:submission id="submit" action="test.jsp"/>
    </xforms:model>
  </head>
  <body>
    <p>
      <xforms:input model="address" ref="name">
        <xforms:label>Name:</xforms:label>
      </xforms:input>
    </p>
    <p>
      <xforms:input model="address" ref="postcode">
        <xforms:label>Postcode:</xforms:label>
      </xforms:input>
    </p>
    <xforms:submit submission="submit">
      <xforms:label>Submit</xforms:label>
    </xforms:submit>
  </body>
</html>

The test.jsp file may contain the following code.

Note:

MarinerServletRequestContext.findInstance(request).getParameter() must be used to retrieve data passed by fragmented forms.

<?xml version="1.0" encoding="UTF-8"?>
<%
response.setContentType("x-application/vnd.xdime+xml");
String name = request.getParameter("name");
String postcode = request.getParameter("postcode");
String hidden = request.getParameter("hidden");
%>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:mcs="http://www.volantis.com/xmlns/2006/01/xdime/mcs">
  <head>
    <title>Form Submission</title>
  </head>
  <body>
    <div>
      <h4>Hello <%=name%> (<%=hidden%>) Postcode: <%=postcode%> </h4>
    </div>
  </body>
</html>

Related topics