Error label addition - Demonstration

Place improper data in the fields below and you will see the error displayed next to the field.

Address
Street
100
House Number
10
Flat Number
10
Post Code
Post
50
City
50
XML output

        
Error label addition - Description

The default behavior of the MForm controls tree is to display one validator for all MForm controls. This validator can be displayed before or after the MForm content, but it does not provide a way to display the error near the field.

There is however an Addition control that can attach error displaying to the field. This Addition is called ErrorLabelAddition. This control creates an extra span near the field. On the client side, the object corresponding to this addition plugs into the item's constraint events. These events are fired every time the constraint is checked and returns either positive or negative result.

The ErrorLabelAddition works on the field level and if the MForm Root validator is not changed, the error will be displayed in both places: in the Root validator and in the Error Label addition. To turn off Root validator displaying, set its Display property to None.

You can see that the Error label addition is attached to every Leaf control on the page, which is not very convenient. To override this problem, read the description of the Additions attacher.