Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: validation built form with cgi::ex::validate that has radio buttons

by Anonymous Monk
on May 19, 2014 at 11:55 UTC ( [id://1086651]=note: print w/replies, xml ) Need Help??


in reply to validation built form with cgi::ex::validate that has radio buttons

See https://metacpan.org/pod/CGI::Ex::Validate#GROUP-OPTIONS "group" isn't radio

If you view the source to see sub generate_form { you'll see it takes a htype option , so specify htype somehow ... check the dist tree for an example of usage (grep "radio|check|htype" https://metacpan.org/release/CGI-Ex )

if that fails study the code

} elsif ($type eq 'radio' || $type eq 'checkbox') { my $e = $field->{'enum'} || []; my $l = $field->{'label'} || $e; my $I = @$e > @$l ? $#$e : $#$l; for (my $i = 0; $i <= $I; $i++) { my $_e = $e->[$i]; $_e =~ s/\"/&quot;/g; $input .= "<div class=\"option\"><input type=\"$type\" + name=\"$field->{'field'}\" id=\"$field->{'field'}_$i\" value=\"$_e\" +>" .(defined($l->[$i]) ? $l->[$i] : '')."</div>\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1086651]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-25 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found