
datlaravi
Deleted
Jun 7, 2000, 12:34 PM
Post #1 of 1
(135 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
|