uuid validator

Validate an UUID

Options

Using with form field

The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
message data-fv-uuid___message String The error message
version data-fv-uuid___version String The UUID version. Can be 3, 4, 5 or all (the default version)

Using with JavaScript module


// You might need to change the importing path
import uuid from 'formvalidation/validators/uuid';

const result = uuid().validate({
    value: ...,
    options: {
        message: ...,
    },
});
/*
result is an object of
{
    valid: true or false,
    message: The error message
}
*/

Related validators

The following validators are similar to this one and might be useful to you.

Name Description
regexp Check if the value matches given JavaScript regular expression