logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Wrong caption for radio button group in static mode in FB 3.02: msg#00027

Subject: Re: Wrong caption for radio button group in static mode in FB 3.02
Liu, Aaron wrote:
The hidden value is correct, but the shown value is not (I think it is just showing the first item in the radio group.) This is similar to the drop down list case I think. Daitau Aaron

I believe I've isolated this already. Try the attached patch against Field.pm and let me know if it fixes it.

I've added test cases to check for this in future releases.

-Nate
--- CGI/FormBuilder/Field.pm    2005/04/27 17:58:19     1.40
+++ CGI/FormBuilder/Field.pm    2005/04/27 18:03:22
@@ -797,15 +797,17 @@
             # if have options, lookup the label instead of the true value
             for (@opt) {
                 my($o,$n) = optval($_);
-                $n ||= $attr{labels}{$o} || ($self->nameopts ? toname($o) : 
$o);
-                $value = $n, last if $n;
+                if ($o eq $value) {
+                    $n ||= $attr{labels}{$o} || ($self->nameopts ? toname($o) 
: $o);
+                    $value = $n;
+                    last;
+                }
             }
 
             # print the value out too when in a static context, EXCEPT for
             # manually hidden fields (those that the user hid themselves)
             my $tagcom = escapehtml($value);
             $tag .= $tagcom . ' ' if $self->static && $tagcom && $usertype ne 
'hidden';
-            debug 2, "if ", $self->static, " && $tagcom && $usertype ne 
'hidden';";
 
             if ($self->growable && $self->javascript) {
                 # put linebreaks between the input tags in growable fields

Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>