Report an issue
Class

CKEDITOR.dialog.validate

class singleton

The namespace with dialog helper validation functions.

Filtering

Methods

  • cssLength( msg ) → Function

    Checks if a dialog UI element value is a correct CSS length value.

    It allows px, em, ex, in, cm, mm, pt, pc units.

    CKEDITOR.dialog.validate.cssLength( 'error!' )( '10pt' ) // true
    CKEDITOR.dialog.validate.cssLength( 'error!' )( 'solid' ) // error!
    

    Parameters

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • equals( value, msg ) → Function

    Checks if a dialog UI element value and the given value are equal.

    CKEDITOR.dialog.validate.equals( 'foo', 'error!' )( 'foo' ) // true
    CKEDITOR.dialog.validate.equals( 'foo', 'error!' )( 'baz' ) // error!
    

    Parameters

    value : String

    The value to compare.

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • functions( validators, [ msg ], [ relation ] ) → Function

    Performs validation functions composition.

    CKEDITOR.dialog.validate.functions(
        CKEDITOR.dialog.validate.notEmpty( 'Value is required.' ),
        CKEDITOR.dialog.validate.number( 'Value is not a number.' ),
        'error!'
    );
    

    Parameters

    validators : Function...

    Validation functions which will be composed into a single validator.

    [ msg ] : String

    Error message returned by the composed validation function.

    [ relation ] : Number

    Indicates a relation between validation functions. Use CKEDITOR.VALIDATE_OR or CKEDITOR.VALIDATE_AND.

    Defaults to CKEDITOR.VALIDATE_OR

    Returns

    Function

    Composed validation function.

  • htmlLength( msg ) → Function

    Checks if a dialog UI element value is a correct HTML length value.

    It allows px units.

    CKEDITOR.dialog.validate.htmlLength( 'error!' )( '10px' ) // true
    CKEDITOR.dialog.validate.htmlLength( 'error!' )( 'solid' ) // error!
    

    Parameters

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • inlineStyle( msg ) → Function

    Checks if a dialog UI element value is a correct CSS inline style.

    CKEDITOR.dialog.validate.inlineStyle( 'error!' )( 'height: 10px; width: 20px;' ) // true
    CKEDITOR.dialog.validate.inlineStyle( 'error!' )( 'test' ) // error!
    

    Parameters

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • integer( msg ) → Function

    Checks if a dialog UI element value is an Integer.

    CKEDITOR.dialog.validate.integer( 'error!' )( '123' ) // true
    CKEDITOR.dialog.validate.integer( 'error!' )( '123.321' ) // error!
    

    Parameters

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • notEmpty( msg ) → Function

    Checks if a dialog UI element value is not an empty string.

    CKEDITOR.dialog.validate.notEmpty( 'error!' )( 'test' ) // true
    CKEDITOR.dialog.validate.notEmpty( 'error!' )( '  ' ) // error!
    

    Parameters

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • notEqual( value, msg ) → Function

    Checks if a dialog UI element value and the given value are not equal.

    CKEDITOR.dialog.validate.notEqual( 'foo', 'error!' )( 'baz' ) // true
    CKEDITOR.dialog.validate.notEqual( 'foo', 'error!' )( 'foo' ) // error!
    

    Parameters

    value : String

    The value to compare.

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • number( msg ) → Function

    Checks if a dialog UI element value is a Number.

    CKEDITOR.dialog.validate.number( 'error!' )( '123' ) // true
    CKEDITOR.dialog.validate.number( 'error!' )( 'test' ) // error!
    

    Parameters

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.

  • regex( regex, msg ) → Function

    Checks if a dialog UI element value meets the regex condition.

    CKEDITOR.dialog.validate.regex( 'error!', /^\d*$/ )( '123' ) // true
    CKEDITOR.dialog.validate.regex( 'error!' )( '123.321' ) // error!
    

    Parameters

    regex : RegExp

    Regular expression used to validate the value.

    msg : String

    Validator error message.

    Returns

    Function

    Validation function.