Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [DogTags] Auto Generate Form Fields: Edit Log

Here is the list of edits for this post
Re: [DogTags] Auto Generate Form Fields
This should do the trick for database selection:

Code:
sub {
my %tmp = ();
my $html = $DB->html( ['Countries'], $IN );
my $sth = $DB->table('Countries')->select('Country_Value', 'Country_Name');
$tmp{$val} = $name while (my ($val, $name) = $sth->fetchrow);

return(
$html->select({
name => 'Country',
value => scalar $IN->param('Country'),
values => \%tmp

})
);
}

That assumes all your country names/values are in a table called "Countries" and the column names are "Country_Name" and "Country_Value"

Last edited by:

Paul: Apr 8, 2003, 7:34 AM

Edit Log: