Skip to content

Instantly share code, notes, and snippets.

@dbcooper
Created December 16, 2011 18:21
Show Gist options
  • Select an option

  • Save dbcooper/1487239 to your computer and use it in GitHub Desktop.

Select an option

Save dbcooper/1487239 to your computer and use it in GitHub Desktop.
Minor code modification
diff --git a/lib/HTML/FormHelpers.pm b/lib/HTML/FormHelpers.pm
index fba2ae6..30ba810 100644
--- a/lib/HTML/FormHelpers.pm
+++ b/lib/HTML/FormHelpers.pm
@@ -99,7 +99,7 @@ sub radio {
while ($i < @$values) {
my ($val,$disp) = @{$values}[$i, $i+1];
my $checked = $on eq $val ? 'checked="checked"' : "";
- push @ret, qq(<input type="radio" name="$fname" value="$val" $checked $attributes />$disp);
+ push @ret, qq(<label><input type="radio" name="$fname" value="$val" $checked $attributes />$disp</label>);
} continue { $i+=2 }
return ref $sep eq 'ARRAY' ? @ret : join $sep,@ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment