Skip to content

Commit

Permalink
just check the values
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 16, 2016
1 parent dac01cd commit 1806ccb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -65,12 +65,10 @@ sub _input {
my ($c, $name) = (shift, shift);
my %attrs = @_ % 2 ? (value => shift, @_) : @_;

# Special selection value
my @values = @{$c->every_param($name)};
my $type = $attrs{type} || '';
if (@values && $type ne 'submit') {
if (my @values = @{$c->every_param($name)}) {

# Checkbox or radiobutton
my $type = $attrs{type} || '';
if ($type eq 'checkbox' || $type eq 'radio') {
delete $attrs{checked} if @values;
my $value = $attrs{value} // 'on';
Expand Down

0 comments on commit 1806ccb

Please sign in to comment.