Anarchist
07-16-2005, 01:29 AM
I am trying to use a drop down box in my Perl form, the box should get its contents the list of data from a table in my database, how is this done?
At the moment I am stuck using the entire amount of data in my script which is ugly, I know there is a way to populate my box with the data but I cannot get my head around it.
Anyone know how?
This is what I am trying to escape from, I want the options filled dynamically from the table in the DB.
#!Perl
#output web page
print <<PAGE;
<html>
<head>
</head>
<body>
<FORM METHOD="GET" ACTION="dbooking.htm">
<form name="jump">
<select name="menu">
<option value="">London</option>
<option value="">Cardiff</option>
<option value="">Liverpool</option>
<option value="">Swansea</option>
<option value="">Newcastle</option>
<option value="">Middlesbrough</option>
<option value="">Manchester</option>
<option value="">Wigan</option>
<option value="">Wolverhampton</option>
<option value="">Edinburgh</option>
</select>
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
</div>
</body>
</html>
PAGE
exit 0;
#end script processing
At the moment I am stuck using the entire amount of data in my script which is ugly, I know there is a way to populate my box with the data but I cannot get my head around it.
Anyone know how?
This is what I am trying to escape from, I want the options filled dynamically from the table in the DB.
#!Perl
#output web page
print <<PAGE;
<html>
<head>
</head>
<body>
<FORM METHOD="GET" ACTION="dbooking.htm">
<form name="jump">
<select name="menu">
<option value="">London</option>
<option value="">Cardiff</option>
<option value="">Liverpool</option>
<option value="">Swansea</option>
<option value="">Newcastle</option>
<option value="">Middlesbrough</option>
<option value="">Manchester</option>
<option value="">Wigan</option>
<option value="">Wolverhampton</option>
<option value="">Edinburgh</option>
</select>
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
</div>
</body>
</html>
PAGE
exit 0;
#end script processing