XForms Behavior (Actions)
- Previous Page XForms Attributes
- Next Page XForms Functions
XForms behaviors can handle responses to events.
Message Behavior
The <message> element in XForms can define a message that is displayed on the XForms user interface.
Please see this simplified example:
<input ref="fname"> <label>First Name</label> <message level="ephemeral" event="DOMFocusIn"> Input Your First Name </message> </input>
In the above example, when the user focuses on this input field,"Input Your First Name" This message can be displayed as a tooltip:
event="DomFocusIn" Events that can trigger the behavior can be defined.
level="ephemeral" Messages that can be displayed as tooltips can be defined.
Other values of the level attribute are modal and modeless, which can define different types of message boxes (dialogs).
Setvalue Behavior
The XForms element <setvalue> can define the value to be set when an event responds.
Please see this simplified example:
<input ref="size"> <label>Size</label> <setvalue value="50" event="xforms-ready"/> </input>
In the above example, when the form is opened, the value 50 will be stored in the instance element <size>.
- Previous Page XForms Attributes
- Next Page XForms Functions