Index: openacs-4/packages/acs-templating/www/doc/demo/state.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/state.tcl,v diff -u -r1.1.1.1.30.1 -r1.1.1.1.30.2 --- openacs-4/packages/acs-templating/www/doc/demo/state.tcl 10 Sep 2015 08:22:12 -0000 1.1.1.1.30.1 +++ openacs-4/packages/acs-templating/www/doc/demo/state.tcl 24 May 2016 15:00:49 -0000 1.1.1.1.30.2 @@ -2,36 +2,27 @@ $Id$ } -query { state_abbrev -} -properties {} - -request create - -request set_param state_abbrev -datatype keyword -validate { - { regexp {CA|HI|NV} $value } - { Invalid state abbreviation $value. } +} -properties {} -validate { + validate_state_abbreaf -requires state_abbrev { + if {$state_abbrev ni {CA HI NV}} { + ad_complain "Invalid state abbreviation $state_abbrev." + } + } } -# demonstrate the separate error page - -if { [ns_queryexists errorpage] } { - - if { [request is_valid] } { return } - -} else { - - request is_valid self +set query { + select + first_name, last_name, state + from + ad_template_sample_users + where + state = :state_abbrev + order by last_name } + +db_multirow users state_query $query -set query "select - first_name, last_name, state - from - ad_template_sample_users - where - state = :state_abbrev - order by last_name" - -db_multirow users state_query $query # Local variables: # mode: tcl # tcl-indent-level: 4