How to Populate Drop-down list Dynamically.
- From: jainprithviraj@xxxxxxxxx
- Date: 21 Feb 2006 02:21:35 -0800
Hi,
I am writing a Perl -CGI script and want to dynamically load the
drop-down list using the values retrieved from the database.
I am accepting the values retrieved from the database into the array
and then using it to populate the drop-down. But only the last value
gets populated in the dropdown.
Plz anybody help me out.
Code goes as follows:
my @PName=("A","B","C");
print<<print_tag;
<html><head><title>Hi</title></head><form method=POST action=" ">
Name
<select size="1" name="D1">
for($temp=0;$temp<$#PName;$temp++)
{
<option>$PName[$temp]</option>
}
</select>
</form></html>
print_tag
.
- Follow-Ups:
- Re: How to Populate Drop-down list Dynamically.
- From: mcburney
- Re: How to Populate Drop-down list Dynamically.
- Prev by Date: RE: Prepare error
- Next by Date: query DBI:Pg code utf-8
- Previous by thread: Bad argument while running the program
- Next by thread: Re: How to Populate Drop-down list Dynamically.
- Index(es):
Relevant Pages
|