VDaemon PHP Library | VDaemon Extension | Table of Contents

VDaemon Reference
<VLLABEL> Custom Tag

You may need to display an error message or highlight some text at or near the location where an input validation error has occurred. The vllabel custom tag provides you an easy yet powerful way to accomplish this. Each vllabel tag references one or more validators (vlvalidator or vlgroup tags). The logical "AND" is applied to the vlvalidator references to determine how the vllabel tag will be rendered on a page. vllabel also can change style of the form input element.

When VDaemon parses page it replaces all vllabel custom tags to label html tags. You can use any attribute of label tag inside vllabel tag - it will be kept after replacement.

Syntax
<vllabel
      form="formName"
      for="inputFieldName"
      class="cssStyle"
      errclass="cssStyle"
      cerrclass="cssStyle"
      errtext="errorText"
      validators="validatorName[, validatorName ...]">
   Default text
</vllabel>
Form Attribute

Specifies form name to which this label belongs. This attribute is not requiered if label tag located inside vdaemon form.

For Attribute

Associates vllabel with the form input element. Binding to id or name attributes of input element is allowed.

Class Attribute

Sets the CSS style for the default text. Default text will be displayed in place of vllabel tag if each validator referenced in validators attribute has not reported an error.

ErrClass Attribute

Sets the CSS style for the ErrText attribute text. If the ErrClass attribute is not defined, the CSS style defined by the Class attribute will be used instead.

CErrClass Attribute

Sets the CSS style for the associated input element if any validator referenced in the validators attribute has reported an error.

ErrText Attribute

The ErrText attribute text will be displayed in place of the vllabel tag if any validator referenced in the validators attribute has reported an error. If the ErrText attribute is not defined, the default text will be used instead.

Validators Attribute

The validators attribute contains a set of references to one or more vlvalidator or vlgroup tags whose states will determine how the vllabel tag will be rendered. If any of the validators has reported an error the ErrText attribute text with ErrClass attribute CSS style will be displayed in place of vllabel tag, otherwise the default text with Class attribute CSS style will be displayed.