MaskedField

MaskedField is a TextField that allows you to restrict and format the values that can be entered into it.

Component’s XML-name: maskedField.

Basics

MaskedField repeats the functionality of TextField, but it is convenient to use MaskedField for dates, social security numbers, tax IDs, and phone numbers, for example:

<layout spacing="true">
    <maskedField id="maskedField"
                 caption="Phone number"
                 mask="(###) ###-##-##"/>
</layout>
masked field

Attributes

mask

The mask attribute allows you to set a mask for the field. You can use the following characters:

  • # – number

  • U – uppercase letter

  • L – lowercase letter

  • ? – letter

  • А – letter or number

  • * – any character

  • H – uppercase hex character

  • h – lowercase hex character

  • ~ – plus (+) or minus (-) character

valueMode

The valueMode attribute allows you to define a format of a returned value (with a mask or not). This attribute can take two values:

  • clear - sets by default. For the example above, the returned value will be 9967467927.

  • masked - for the example above, the returned value will be 996-746-79-27.