dp_insert_checkbox name values { on_value "t" } { hidden_field_name "_cv" }What it does:
Inserts a checkbox and marks it if necessary (the value is on or Y). Also inserts a hidden field to record an uncheck in the box if necessary. Note that the name _cv stands for _check_vars, but is abbreviated so as to not hit the limit in the size of a get too easily.Defined in: /web/philip/tcl/data-pipeline-defs.tcl
Source code:
if { ![empty_string_p $values] } {
for {set i 0} {$i<[ns_set size $values]} {incr i} {
if {[ns_set key $values $i] == $name} {
set value [philg_quote_double_quotes [ns_set value $values $i]]
break;
}
}
}
set str "
<input type=hidden name=\"$hidden_field_name\" value=\"$name\">
<input type=checkbox name=\"$name\" value=$on_value"
if { [info exists value] && $value == "$on_value" } {
append str " checked"
}
append str ">"
return $str