I am using a snippet of code found in the thread:
Thread reference: http://gossamer-threads.com/p/002323
Topic: Select in default.cfg OR second db ??
Yokhannan - March 10, 2000
What this code does in pull in a select list from an external file. The code is:
|;
open(SELECT,"pteam.txt") || die "Can't open file";
@pteam_list = (<SELECT> );
close (SELECT);
print qq|<select name="PTeam">|;
foreach (@pteam_list) {
chomp $_;
print qq| <option>$rec{'PTeam'}</option>|;
print "$_\n";
}
print qq|</select>
With a note to keep a blank line as the first line in the file.
This works great for adding the records into the database, but when I modify the record it shows the original selection prior to every other option in the file :)
Can someone help me by giving me suggestions on how I can modify the code to prevent this. The list I'm using is very long, so I'd like to keep it in an external text file. It will then be easier to keep this field updated if necessary.
Any help is greatly appreciated.
Lois
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/
Thread reference: http://gossamer-threads.com/p/002323
Topic: Select in default.cfg OR second db ??
Yokhannan - March 10, 2000
What this code does in pull in a select list from an external file. The code is:
|;
open(SELECT,"pteam.txt") || die "Can't open file";
@pteam_list = (<SELECT> );
close (SELECT);
print qq|<select name="PTeam">|;
foreach (@pteam_list) {
chomp $_;
print qq| <option>$rec{'PTeam'}</option>|;
print "$_\n";
}
print qq|</select>
With a note to keep a blank line as the first line in the file.
This works great for adding the records into the database, but when I modify the record it shows the original selection prior to every other option in the file :)
Can someone help me by giving me suggestions on how I can modify the code to prevent this. The list I'm using is very long, so I'd like to keep it in an external text file. It will then be easier to keep this field updated if necessary.
Any help is greatly appreciated.
Lois
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/