xforms-required (event)Added by IBM on August 8, 2013 | Version 1 (Original)
|Occurs when an data node that is optional (required = false) becomes required, or when a data node that is required changes value and remains required.
This event is triggered on the XForms control bound to that node.
Available In xforms:input, xforms:output, xforms:range, xforms:secret, xforms:select, xforms:select1, xforms:submit, xforms:textarea, xforms:trigger, xforms:upload
Example This example shows a field item that accepts the first name of the user's spouse. When the user selects the "married" radio button, this field becomes required and the xforms-required event is triggered. In this case, the event triggers the xforms:message action, which tells the user that the spousal information is required.
The following bind sets makes the spouse's last name required if the married radio button is selected:
The following code defines the label that displays the total:
required="../marital_status = 'married'"/>
<xforms:label>Spouse's First Name:</xforms:label>
<xforms:message ev:event="xforms-required" level="modal"
>You must provide all listed spousal information.</xforms:message>
- The order in which user interface events are processed is indeterminate. This means you cannot rely on them processing in a particular order.