XForms Alert Element


This message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec). The message of the alert element can exist in instance data, in a remote document, or as inline text. If more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text.


  • Single-Node Binding
  • Linking
    • src - URL of a document whose contents will be retrieved by the alert element and used to provide the alert message for the containing form control.

Type restrictions

The alert element can be bound to any simple content.


Can be represented in two ways:

  • modeless window that contains the alert element's message (default representation).
  • the alert element's message can also be displayed immediately after the containing form control element in the XForms document's layout. This representation is used if the alert element has an inline display style.


  <data xmlns="">
 <xforms:bind id="x" nodeset="x" type="xsd:integer"/>

 @namespace xforms url("http://www.w3.org/2002/xforms");
 xforms|input:invalid xforms|alert.inline
   display: inline;
   font-style: italic;
   width: 40%;

<xforms:input bind="x">
 <xforms:label>You can type only numbers (validation happens on blur): </xforms:label>
 <xforms:alert>Wrong value! You should type only numbers!</xforms:alert>

<xforms:input bind="x">
 <xforms:label>You can type only numbers (validation happens on blur): </xforms:label>
 <xforms:alert class="inline">Wrong value! You should type only numbers!</xforms:alert>

Document Tags and Contributors

 Contributors to this page: Sheppy, Surkov.alexander
 Last updated by: Sheppy,