Open topic with navigation

# getValidator

The `getValidator` method returns a callable validator object. You can pass a string input to the validator object to validate some text.

## Syntax

    getValidator( id )

## Arguments

Argument | Description
--- | ---
`id` | (string) The ID of the validator that you want to use.

## Returns

A callable validator object, or `nil` if the parameter was not a valid validator ID.

When you pass a string to the validator object, it returns a normalized match if the input is valid, or `nil` if the input is not valid.

## Examples

    taskUtils:getValidator("BAD_ID")

This example returns nil because the validator ID is not valid.

    taskUtils:getValidator("NAME")("My name is Alice")

This example returns the normalized text `Alice` (assuming that `NAME` is the ID of a validator that matches common names).

    taskUtils:getValidator("NAME")("I don't want to give my name")

This example returns nil, because the text does not include any common names.

© 2016-2018 EntIT Software LLC, a Micro Focus company | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm