+
+% if ( $opt{'add_inline'} ) {
+
+% foreach my $add_field ( @{ $opt{'add_fields'} } ) {
+% my $label = scalar(@{ $opt{'add_fields'} }) > 1
+% ? $add_field : $opt{'label'};
+
+ <& /elements/tr-input-text.html,
+ 'label' => "New $label",
+ 'field' => $field."_$add_field",
+ 'id' => $field."_$add_field",
+ 'colspan' => $opt{'colspan'},
+ &>
+
+% }
+
+
+% unless ( $opt{'html_only'} ) {
+
+ <SCRIPT TYPE="text/javascript">
+
+% my $ge = 'document.getElementById';
+
+ function <% $field %>_changed(what) {
+
+ var value = what.options[what.selectedIndex].value;
+
+ var display = 'none';
+ var visibility = 'hidden';
+ if ( value == '-1' && ! what.disabled ) {
+ display = '';
+ visibility = '';
+ }
+
+% foreach my $add_field ( @{ $opt{'add_fields'} } ) {
+% my $ge_f = "$ge('${field}_$add_field";
+ <% $ge_f %>_label0').style.display = display;
+ <% $ge_f %>_label0').style.visibility = visibility;
+ <% $ge_f %>_input0').style.display = display;
+ <% $ge_f %>_input0').style.visibility = visibility;
+% }
+
+ }
+
+ <% $field %>_changed(<% $ge %>('<% $field %>'));
+
+ </SCRIPT>
+
+% }
+
+% }
+