template::data::validate::boolean (public)
template::data::validate::boolean value_ref message_ref
Defined in packages/acs-templating/tcl/data-procs.tcl
Validates boolean data types.
- 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
- Author:
- Roberto Mello
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- validate_boolean
Source code: upvar 2 $message_ref message $value_ref value set result "" set value [::string tolower $value] switch -- $value { 0 - 1 - f - t - n - y - no - yes - false - true { set result 1 } default { set result 0 set message "[_ acs-templating.Invalid_choice] \"[ns_quotehtml $value]\"" } } return $resultXQL Not present: Generic, PostgreSQL, Oracle