CKEDITOR.dialog.validate
The namespace with dialog helper validation functions.
Filtering
Methods
cssLength( msg ) → FunctionCKEDITOR.dialog.validate#cssLengthChecks if a dialog UI element value is a correct CSS length value.
It allows
px,em,ex,in,cm,mm,pt,pcunits.CKEDITOR.dialog.validate.cssLength( 'error!' )( '10pt' ) // true CKEDITOR.dialog.validate.cssLength( 'error!' )( 'solid' ) // error!Parameters
msg : StringValidator error message.
Returns
FunctionValidation function.
equals( value, msg ) → FunctionCKEDITOR.dialog.validate#equalsChecks 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 : StringThe value to compare.
msg : StringValidator error message.
Returns
FunctionValidation function.
functions( validators, [ msg ], [ relation ] ) → FunctionCKEDITOR.dialog.validate#functionsPerforms validation functions composition.
CKEDITOR.dialog.validate.functions( CKEDITOR.dialog.validate.notEmpty( 'Value is required.' ), CKEDITOR.dialog.validate.number( 'Value is not a number.' ), 'error!' );Note: validation functions should return
truevalue for successful validation. Since 4.19.1 this method does not coerce return type to boolean.Parameters
validators : FunctionValidation functions which will be composed into a single validator.
[ msg ] : StringError message returned by the composed validation function.
[ relation ] : NumberIndicates a relation between validation functions. Use CKEDITOR.VALIDATE_OR or CKEDITOR.VALIDATE_AND.
Defaults to
CKEDITOR.VALIDATE_OR
Returns
FunctionComposed validation function.
htmlLength( msg ) → FunctionCKEDITOR.dialog.validate#htmlLengthChecks if a dialog UI element value is a correct HTML length value.
It allows
pxunits.CKEDITOR.dialog.validate.htmlLength( 'error!' )( '10px' ) // true CKEDITOR.dialog.validate.htmlLength( 'error!' )( 'solid' ) // error!Parameters
msg : StringValidator error message.
Returns
FunctionValidation function.
inlineStyle( msg ) → FunctionCKEDITOR.dialog.validate#inlineStyleChecks if a dialog UI element value is a correct CSS inline style.
CKEDITOR.dialog.validate.inlineStyle( 'error!' )( '' ) // true CKEDITOR.dialog.validate.inlineStyle( 'error!' )( 'height: 10px; width: 20px;' ) // true CKEDITOR.dialog.validate.inlineStyle( 'error!' )( 'test' ) // error!Parameters
msg : StringValidator error message.
Returns
FunctionValidation function.
integer( msg ) → FunctionCKEDITOR.dialog.validate#integerChecks 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 : StringValidator error message.
Returns
FunctionValidation function.
notEmpty( msg ) → FunctionCKEDITOR.dialog.validate#notEmptyChecks 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 : StringValidator error message.
Returns
FunctionValidation function.
notEqual( value, msg ) → FunctionCKEDITOR.dialog.validate#notEqualChecks 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 : StringThe value to compare.
msg : StringValidator error message.
Returns
FunctionValidation function.
number( msg ) → FunctionCKEDITOR.dialog.validate#numberChecks 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 : StringValidator error message.
Returns
FunctionValidation function.
regex( regex, msg ) → FunctionCKEDITOR.dialog.validate#regexChecks if a dialog UI element value meets the regex condition.
CKEDITOR.dialog.validate.regex( /^\d*$/, 'error!' )( '123' ) // true CKEDITOR.dialog.validate.regex( /^\d*$/, 'error!' )( '123.321' ) // error!Parameters
regex : RegExpRegular expression used to validate the value.
msg : StringValidator error message.
Returns
FunctionValidation function.