EvanL
asked on
Populate Drop Down List with Values from CSV DB
I'm using Front Page 98 to create a webpage. I need a Drop Down List to be populated with values from a .CSV database. I use Perl 5 to write CGI scripts sucessfully on other pages on this same site. Anyone know how to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Doh! Also, what code appears in the .cgi file and which goes in the .html file?
I am assuming that each line in the file has one last name listed, as shown below:
SMith
Patrick
etc..
and you have enough knowledge of HTML that is being shown here.
============
The entire HTML file will have to generated by the perl script
===========
$inputdata = "csvfile";
open(DATA, $inputdata);
while (<DATA>) {
($lastname) = split();
push $suppl, $lastname;
}
;display the data as a drop down list
;print table
print "<table>";
print "<tr><td>Select the last name";
print "<td><select name=\"lastname\">";
foreach $element ($suppl) {
print "<option value=$element>$element";
print "\n";
}
print "</select></table>";
-sax
SMith
Patrick
etc..
and you have enough knowledge of HTML that is being shown here.
============
The entire HTML file will have to generated by the perl script
===========
$inputdata = "csvfile";
open(DATA, $inputdata);
while (<DATA>) {
($lastname) = split();
push $suppl, $lastname;
}
;display the data as a drop down list
;print table
print "<table>";
print "<tr><td>Select the last name";
print "<td><select name=\"lastname\">";
foreach $element ($suppl) {
print "<option value=$element>$element";
print "\n";
}
print "</select></table>";
-sax
ASKER
I've increased the points so you will repost.. Thanks!