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
Thanks for the quick reply - I'll check the plug-in later on.

I'm still not sure what to do about the select box...Unsure

Ivan, I read the thread you provided and I see the final code they came up with. I inserted that code in the "template globals" page where it said "new" thus creating a new global called "country", right? The code is:

sub { my $element_name = 'Country'; # set the control's name here
my $default_value = 'xyzty'; # and the default country you'd like to use
my @list = qw(
United States
Internet Based
Afghanistan
Albania
....

rest of the countries

...
Zimbabwe
);
grep { tr,_, ,;0 } @list;
# add your countries here. One per line is ok. my $return = q|<select class=
"Country" name="Country"><option value="">---</option>|; my $tags = shift || {};
my $selected = $tags->{$element_name} || $default_value;
$selected = { map {($_=>1)} ref $selected ? @$selected : $selected };

foreach my $country ( @list ) { my $ischosen = $selected->{$country} ? " selected" : ""; $return .= qq|<option$ischosen>$country</option>|; }

$return .= q|</select>|;

return $return; }




In the "include form.html" template I now have:

<tr><td
valign="top"><%body_font%>Country: </font></td>
<td> <%Country%>>
</td></tr>

and when on the website I get this message where I wanted the select box to be:

Unable to compile 'Country':>



Have no idea what this all means - I'm not a perl programmer... all I know is how to copy and paste (+ minor changes" where I'm told Crazy

Thanks,

Anne

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 9029 Aug 15, 2002, 2:15 PM
Post Re: [Anat] Select/Enum field in Form + how to create new pages
nt6 8694 Aug 15, 2002, 2:24 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8681 Aug 15, 2002, 2:30 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8677 Aug 15, 2002, 3:09 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8700 Aug 15, 2002, 3:22 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8699 Aug 16, 2002, 12:05 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
Anat 8692 Aug 16, 2002, 2:21 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
Anat 8639 Aug 16, 2002, 2:31 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8703 Aug 17, 2002, 12:55 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8617 Aug 17, 2002, 2:48 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8670 Aug 17, 2002, 3:00 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8649 Aug 17, 2002, 3:54 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8627 Aug 17, 2002, 4:01 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8645 Aug 17, 2002, 5:02 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8631 Aug 17, 2002, 6:12 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8623 Aug 17, 2002, 6:50 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8633 Aug 17, 2002, 6:53 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8601 Aug 17, 2002, 7:26 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8644 Aug 17, 2002, 8:02 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8600 Aug 17, 2002, 8:18 AM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8642 Aug 17, 2002, 8:32 AM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8675 Aug 17, 2002, 12:13 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8666 Aug 17, 2002, 12:18 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 8638 Aug 17, 2002, 12:24 PM
Thread Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 8683 Aug 17, 2002, 12:26 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 1970 Aug 17, 2002, 1:25 PM
Post Re: [Anat] Select/Enum field in Form + how to create new pages
yogi 1960 Aug 17, 2002, 1:28 PM
Thread Re: [yogi] Select/Enum field in Form + how to create new pages
Anat 1974 Aug 17, 2002, 10:54 PM
Post Re: [Anat] Select/Enum field in Form + how to create new pages
xpert 1856 Jul 13, 2003, 3:46 AM