us_state_widget (public, deprecated)

 us_state_widget [ default ] [ select_name ]

Defined in packages/acs-tcl/tcl/widgets-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Returns a state selection box. This widget depends on the ref-us-states package. DEPRECATED for various reasons: doesn't comply with OpenACS naming convention, difficult to style, no good separation of Tcl and HTML, 'select_name' is prone to code injection and the proc depends on an external package. A better alternative would be e.g. implementing this using the templating system.

Parameters:
default (optional)
select_name (optional, defaults to "usps_abbrev")
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) db_foreach db_foreach (public) us_state_widget us_state_widget us_state_widget->ad_log_deprecated us_state_widget->db_foreach

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc us_state_widget
   set widget_value "<select name=\"$select_name\">\n"
   if { $default eq "" } {
       append widget_value "<option value=\"\" selected=\"selected\">Choose a State</option>\n"
   }

   db_foreach all_states {
       select state_name, abbrev from us_states order by state_name
   } {
       if { $default == $abbrev } {
           append widget_value "<option value=\"$abbrev\" selected=\"selected\">$state_name</option>\n"
       } else {
           append widget_value "<option value=\"$abbrev\">$state_name</option>\n"
       }
   }
   append widget_value "</select>\n"
   return $widget_value
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/widgets-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: