XForms/Validation with Bind

Motivation
You want to validate a single field based on a rule and alert the user if they enter an invalid value.

Method
We will use an XForms bind expression: 

This last line says that if the current element is greater than zero then the rule passes and the field is valid.

Sample Code
  

 Validation With Bind To pass this test the form must warn the user if they enter  Positive Decimal Amount: Amount must be a positive decimal number.   Negative Decimal Amount: Amount must be a negative decimal number. </xf:input>