Aki, for select pull down menus I use this code in a global:
my ($select_db, $select_field, $select_default) = @_;
my $html = $DB->html ( [$select_db], $IN );
return $html->select ( { name => $select_field, value => $select_default });
}
I call the global with Database I want to use, Field, and default values. something like:
<%global(a,b,$c)%>
$c is the default value for the select (form)
The select it's a method of the html class or object or DB class/object (not sure of object oriented terminology sorry) So I guess the checkbox method should be implemented if not already there right? the point is: if It is SO EASY to display a select based on values entered in the admin, why can not be the above global used for displaying radio and checkboxes as well?
Code:
sub { my ($select_db, $select_field, $select_default) = @_;
my $html = $DB->html ( [$select_db], $IN );
return $html->select ( { name => $select_field, value => $select_default });
}
I call the global with Database I want to use, Field, and default values. something like:
<%global(a,b,$c)%>
$c is the default value for the select (form)
The select it's a method of the html class or object or DB class/object (not sure of object oriented terminology sorry) So I guess the checkbox method should be implemented if not already there right? the point is: if It is SO EASY to display a select based on values entered in the admin, why can not be the above global used for displaying radio and checkboxes as well?