[Bps-public-commit] rt-extension-formtools branch, master, updated. 0.07_07-19-gbc5d21f

Kevin Falcone falcone at bestpractical.com
Mon Feb 13 14:19:31 EST 2012


The branch, master has been updated
       via  bc5d21f6622339fa4843c4e74c05285f0d6556e0 (commit)
      from  494ac969ded4e63a020fa7f4875e4b2ffbc9be2b (commit)

Summary of changes:
 html/FormTools/Field |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit bc5d21f6622339fa4843c4e74c05285f0d6556e0
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Wed Feb 1 16:41:31 2012 -0600

    add in hidden input tags for different render_as
    
    When render_as is readonly_plus_values, then add in the hidden inputs.

diff --git a/html/FormTools/Field b/html/FormTools/Field
index 83182c6..467dec4 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -131,16 +131,22 @@ unless ( $default ) {
 
 <input type="hidden" name=<%$name%> value="<%$default%>">
 
-% } elsif ($render_as eq 'readonly') {
+% } elsif ($render_as eq 'readonly' or $render_as eq 'readonly_plus_values') {
 
 % if (@values > 1) {
     <ul>
 % for (@values) {
     <li class="readonly"><% $_ %></span>
+%   if ($render_as eq 'readonly_plus_values') {
+    <input type="hidden" name="<% $input_name %>" value="<% $_ %>"/>
+%   }
 % }
     </ul>
 % } else {
     <span class="readonly"><% $default %></span>
+%   if ($render_as eq 'readonly_plus_values') {
+    <input type="hidden" name="<% $input_name %>" value="<% $default %>"/>
+%   }
 % }
 
 % } else {
@@ -240,12 +246,15 @@ unless ( $default ) {
 <& /Elements/SelectDate, Name => $input_name .'s', current => 0, 
                          ($default ? (Default => $default) : ()) &>
 
-% } elsif ($render_as eq 'readonly') {
+% } elsif ($render_as eq 'readonly' or $render_as eq 'readonly_plus_values') {
 
 % if (@values > 1) {
     <ul>
 % for (@values) {
     <li name="<% $input_name %>" class="readonly"><% $_ %></li>
+%   if ($render_as eq 'readonly_plus_values') {
+    <input type="hidden" name="<% $input_name %>" value="<% $_ %>"/>
+%   }
 % }
     </ul>
     <script>
@@ -256,6 +265,9 @@ unless ( $default ) {
 
 % } else {
     <span name="<% $input_name %>" class="readonly"><% $default %></span>
+%   if ($render_as eq 'readonly_plus_values') {
+    <input type="hidden" name="<% $input_name %>" value="<% $default %>"/>
+%   }
 % if ( my $disable = $disables->{ $default } ) {
     <script>
         jQuery(function() { disable_form_field(true, '<% $disable %>') } );

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list