Skip to content

Instantly share code, notes, and snippets.

@avernet
Created January 14, 2016 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avernet/395029bff2531e178a81 to your computer and use it in GitHub Desktop.
Save avernet/395029bff2531e178a81 to your computer and use it in GitHub Desktop.
Field shown depending on value of other field
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
<xh:head>
<xf:model>
<xf:instance>
<instance>
<marital-status>single</marital-status>
<spouse/>
</instance>
</xf:instance>
<xf:bind ref="/instance/spouse" relevant="/instance/marital-status = 'married'"/>
</xf:model>
</xh:head>
<xh:body>
<xf:select1 ref="marital-status" appearance="full">
<xf:label>Marital status</xf:label>
<xf:item>
<xf:label>Single</xf:label>
<xf:value>single</xf:value>
</xf:item>
<xf:item>
<xf:label>Married</xf:label>
<xf:value>married</xf:value>
</xf:item>
</xf:select1>
<xf:input ref="spouse">
<xf:label>Spouse</xf:label>
</xf:input>
</xh:body>
</xh:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment