Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [yogi] Select/Enum field in Form + how to create new pages

Quote Reply
Re: [yogi] Select/Enum field in Form + how to create new pages In reply to
Yes, both set to CHAR(50), not null, column index: regular

Here are the two globals again - maybe you can see something I don't?


country_select

sub {
my $element_name = shift;
my $selected_value = shift;
my $default_value = shift || 'United_States';

my @list = qw(
United_States
Internet_Based
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua_and_Barbuda
....

Vietnam
Western_Sahara
Yemen
Yugoslavia_(Serbia_and_Montenegro)
Zambia
Zimbabwe

);
my $selected = $selected_value || $default_value;
$selected = { map {($_=>1)} ref $selected ? @$selected : $selected };

my $return = qq|<select name="$element_name"> |;
foreach my $country ( @list ) {
(my $country_nice = $country) =~ s,_, ,g;
my $ischosen = $selected->{$country_nice} ? ' selected="selected"' : '';
$return .= qq|<option value ="$country_nice" $ischosen>$country_nice</option>|;
}
$return .= q|</select>|; return $return;
}





state_select

sub {
my $element_name = shift;
my $selected_value = shift;
my $default_value = shift || 'Alabama';

my @list = qw(
Alabama
Alaska
Arizona
Arkansas
....
Virginia
Washington
West_Virginia
Wisconsin
Wyoming
Outside_the_USA


);
my $selected = $selected_value || $default_value;
$selected = { map {($_=>1)} ref $selected ? @$selected : $selected };

my $return = qq|<select name="$element_name"> |;
foreach my $state ( @list ) {
(my $state_nice = $state) =~ s,_, ,g;
my $ischosen = $selected->{$state_nice} ? ' selected="selected"' : '';
$return .= qq|<option value ="$state_nice" $ischosen>$state_nice</option>|;
}
$return .= q|</select>|; return $return;
}





If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Subject Author Views Date
Thread Select/Enum field in Form + how to create new pages Anat 9017 Aug 15, 2002, 2:15 PM
Post Re: [Anat] Select/Enum field in Form + how to create new pages
nt6 8682 Aug 15, 2002, 2:24 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8669 Aug 15, 2002, 2:30 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8664 Aug 15, 2002, 3:09 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8688 Aug 15, 2002, 3:22 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8687 Aug 16, 2002, 12:05 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
Anat 8680 Aug 16, 2002, 2:21 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
Anat 8626 Aug 16, 2002, 2:31 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8691 Aug 17, 2002, 12:55 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8605 Aug 17, 2002, 2:48 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8658 Aug 17, 2002, 3:00 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8637 Aug 17, 2002, 3:54 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8614 Aug 17, 2002, 4:01 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8633 Aug 17, 2002, 5:02 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8619 Aug 17, 2002, 6:12 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8611 Aug 17, 2002, 6:50 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8620 Aug 17, 2002, 6:53 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8588 Aug 17, 2002, 7:26 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8632 Aug 17, 2002, 8:02 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8588 Aug 17, 2002, 8:18 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8630 Aug 17, 2002, 8:32 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8663 Aug 17, 2002, 12:13 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8654 Aug 17, 2002, 12:18 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8626 Aug 17, 2002, 12:24 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8671 Aug 17, 2002, 12:26 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 1964 Aug 17, 2002, 1:25 PM
Post Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 1955 Aug 17, 2002, 1:28 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 1969 Aug 17, 2002, 10:54 PM
Post Re: [Anat] Select/Enum field in Form + how to create new pages
xpert 1851 Jul 13, 2003, 3:46 AM