beetlebug▾
/

entry validate

Runs the script of -validatecommand now.

PATHNAME validate

Description

Runs the validation with the current text, with %V set to forced, for each mode of -validate other than none. A false result of the script runs -invalidcommand.

Returns

1 when the text is valid or no validation runs, and 0 when the script gives false.

Examples

% entry .va -validate all -vcmd {string is digit %P}
> .va validate
1

% entry .va2
> .va2 insert 0 abc
> .va2 configure -validate all -vcmd {string is digit %P}
> .va2 validate
0

Errors

% entry .va3; .va3 validate x
wrong # args: should be ".va3 validate"
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also