CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
how do i get a value from a dropdown list

 



datlaravi
Deleted

Jun 7, 2000, 12:34 PM

Post #1 of 1 (387 views)
how do i get a value from a dropdown list Can't Post

Hi,
I want to select an option in drop down list and capture that value in a variable and search for that value in the database.
for example
//work.cgi
use CGI;
$value =$query->param('locationName');//not working for the drop down selection
if ($value) {
$select = "select location from ConferenceRooms where location =$value";
print <<"html";
<TR><TD><B>Is Conference Room in one of these buildings:</B></TD></TR>
<tr> <td><select name ="locationName"> </td> </tr>
<option value =0> </option>
<input type ="submit" name ="find" value ="Find it">
html
&buildingList;
print <<"webform";
</select></TD></tr></form>
webform
sub buildingList {
$list= "select location from ConferenceRooms";
$sybHandle = $syb->prepare($list);
$sybHandle->execute();
while (my ($l) = $sybHandle->fetchrow)
{
print <<"html";
<option value=$conferenceRoomId>$l</option>
html
}
$sybHandle->finish();
}
I want to capture the selection and search in the database
Please help me

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives