template::data::validate::naturalnum (public)
template::data::validate::naturalnum value_ref message_ref
Defined in packages/acs-templating/tcl/data-procs.tcl
Validates natural numbers data types. Will trim leading 0 in order to avoid Tcl interpreting it as octal (code borrowed from ad_page_contract_filter_proc_naturalnum)
- 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:
- Rocael Hernandez
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- validate_naturalnum
Source code: upvar 2 $message_ref message $value_ref value set result [regexp {^(0*)(([1-9][0-9]*|0))$} $value match zeros value] if { ! $result } { set message "[_ acs-templating.Invalid_natural_number] \"[ns_quotehtml $value]\"" } return $resultXQL Not present: Generic, PostgreSQL, Oracle