Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.284.2.42 -r1.284.2.43 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 21 Oct 2019 19:28:23 -0000 1.284.2.42 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 22 Oct 2019 16:12:45 -0000 1.284.2.43 @@ -2639,21 +2639,20 @@ } radio instproc render_input {} { set value [:value] - foreach o [:options] { + + set base_atts [:get_attributes disabled] + lappend base_atts \ + type radio \ + name [expr {[info exists :forced_name] ? ${:forced_name} : ${:name}}] + + foreach o ${:options} { lassign $o label rep - set atts [:get_attributes disabled] - if {[info exists :forced_name]} { - set name ${:forced_name} - } { - set name ${:name} - } set id ${:id}:$rep - lappend atts id $id name $name type radio value $rep + set atts [list {*}$base_atts id $id value $rep] if {$value eq $rep} { lappend atts checked checked } - set label_class "" - if {${:horizontal}} {set label_class "radio-inline"} + set label_class [expr {${:horizontal} ? "radio-inline" : ""}] ::html::label -for $id -class $label_class { ::html::input $atts {} ::html::t " $label " @@ -2679,7 +2678,6 @@ next } - checkbox instproc value_if_nothing_is_returned_from_form {default} { # Here we have to distinguish between two cases to: @@ -2696,29 +2694,27 @@ } } checkbox instproc render_input {} { - # identical to radio, except "checkbox" type and "in" expression for value; - # maybe we can push this up to enumeration.... set value [:value] + + set base_atts [:get_attributes disabled] + lappend base_atts \ + type checkbox \ + name ${:name} + foreach o ${:options} { lassign $o label rep set id ${:id}:$rep - set atts [:get_attributes disabled] - lappend atts id $id name ${:name} type checkbox value $rep + set atts [list {*}$base_atts id $id value $rep] if {$rep in $value} {lappend atts checked checked} - set label_class "" - if {${:horizontal}} {set label_class "checkbox-inline"} + set label_class [expr {${:horizontal} ? "checkbox-inline" : ""}] ::html::label -for $id -class $label_class { ::html::input $atts {} ::html::t " $label " } if {!${:horizontal}} { html::br } - - #::html::input $atts {} - #::html::label -for $id {html::t "$label "} - #if {!${:horizontal}} {html::br} } }