xforms:instance

Purpose

Optional element that contains instance data associated with the model element. It is used to supply initial values for forms controls, or to provide additional data to be submitted with the form.

Contains

Contained by

Example

<?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="http://localhost:8080/volantis/response.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>

Related topics