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):
- 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_valueXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/widgets-procs.xql