Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [Halito] Build select menu from other table

Quote Reply
Re: [Halito] Build select menu from other table In reply to
You might add a new global which returns a select tag (or any HTMLs) like the example below:

Code:
sub {
my $tags = shift;
my $table = $DB->table('contacts');
my $sth = $table->select (['Column1', 'Column2']);
my $output = '<select name=select_name multiple>';
while (my $row = $sth->fetchrow_hashref) {
$output .= '<option value='.$row->{Column1}.'>'.$row->{Column2}.'</option>';

}
$output .= '</select>';

return $output;
}

Last edited by:

jean: Mar 1, 2002, 11:02 AM
Subject Author Views Date
Thread Build select menu from other table Halito 5343 Mar 1, 2002, 10:05 AM
Thread Re: [Halito] Build select menu from other table
jean 5211 Mar 1, 2002, 11:00 AM
Thread Re: [jean] Build select menu from other table
Halito 5220 Mar 2, 2002, 10:26 AM
Thread Re: [Halito] Build select menu from other table
jean 5242 Mar 2, 2002, 11:12 AM
Post Re: [jean] Build select menu from other table
Halito 5197 Mar 3, 2002, 10:46 AM
Post Re: [Halito] Build select menu from other table
LanceWilson2 4943 Mar 5, 2003, 3:07 PM