Validating an answer

For questions of the Short text, Number, and TIN type, you can set the Validation option in the block settings.

Use validation if you need to check that an answer meets the specified format. For example, you can check that an answer contains text in Russian or doesn't contain disallowed characters. If an answer doesn't meet the specified format, a warning appears saying that the field is filled in incorrectly.

Select a validation method:

  • No validation: The answer may contain any characters. If you select this method, entered data won't be validated.

  • Email validation: The answer can contain only Latin letters, numbers, and symbols @ . _ - in user@domain.ru format.

  • Link validation: The answer can contain Latin and Russian letters, numbers, and symbols - _ . ~ ! * ' ( ) ; / ? : @ & = + $ ,.

  • Phone number validation: The answer can contain only numbers and symbols + -. A phone number must contain at least 10 characters.

  • Validation of fractional numbers: The answer can contain only an integer or decimal number.

  • TIN validation: The response must contain only a correct taxpayer ID (10 or 12 digits) and pass a checksum verification.

  • Validation of letters from the Cyrillic alphabet: The answer must contain Russian letters, numbers, spaces, and symbols . , ; ( ).

  • Validation using regular expressions: You can create a custom regular expression to validate the answer. For example:

    • A regular expression that only allows entering Latin letters, numbers, and spaces:
      ^[A-Za-z0-9\s]+$
      
    • A regular expression that allows entering any characters, except numbers and some special characters:
      ^[^0-9@#$%^&*]+$