template::data::validate::integer (public)

 template::data::validate::integer value_ref message_ref

Defined in packages/acs-templating/tcl/data-procs.tcl

Validate that a submitted integer contains only an optional sign and the digits 0-9.

Parameters:
value_ref (required)
Reference variable to the submitted value
message_ref (required)
Reference variable for returning an error message
Returns:
True (1) if valid, false (0) if not

Partial Call Graph (max 5 caller/called nodes):
%3 test_validate_integer validate_integer (test acs-templating) template::data::validate::integer template::data::validate::integer test_validate_integer->template::data::validate::integer _ _ (public) template::data::validate::integer->_

Testcases:
validate_integer
Source code:

    upvar 2 $message_ref message $value_ref value

    set result [regexp {^[+-]?\d+$} $value]

    if { ! $result } {
        set message "[_ acs-templating.Invalid_integer] \"[ns_quotehtml $value]\""
    }

    return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: