RE: [PHP] multiple selection dropdown lists

From: Date: Thu, 22 Mar 2001 11:49:33 +0000
Subject: RE: [PHP] multiple selection dropdown lists
Groups: php.general 
Request: Send a blank email to php-general+get-45099@lists.php.net to get a copy of this message
You need to add '[]' to the selects name which informs php that the select field will have more than one value. Once your form has been submitted an array called $comboResultPlan will be available containing the selected options. -Stewart <select name="multi[]" size="5" multiple> -----Original Message----- From: Angie Bauer [mailto:ABauer@btech.co.za] Sent: 22 March 2001 11:31 To: php-general@lists.php.net Subject: [PHP] multiple selection dropdown lists Hi we've got a dropdown list from a select statement, after you choose an option from there it creates another dropdown list also from a select statement. We want to know how to be able to select multiple values from the 2nd one and send them through to the next page for display. Below are the two dropdown lists we have. _____ <select name="comboMAPType" size="1"> <? while ($GetMAPTypeRow = ibase_fetch_row($GetMAPType_Result)) {//begin if ($GetMAPTypeRow[0] == $schemenumber) {//begin $SetInitial = "selected"; }//end else {//begin $SetInitial = ""; }//end ?> <option value="<? echo $GetMAPTypeRow[0]?>" <?echo $SetInitial?> > <? echo $GetMAPTypeRow[1]?> </option> <?}?> </select> <input type="submit" action="default.asp?step=3-rate" value="Continue!" method="post" name="btnContinueQuote"> </h4> </td> </tr> <tr valign="middle"> <td width="46%" height="6"> <? if ($btnContinueQuote) {//begin ?> <? }//end ?> <font size="2" color="#000099" face="Arial, Helvetica, sans-serif">LIST OF MEDICAL AID SCHEMES FROM SEARCH:</font> </td> <td width="54%" height="6"> <select name="comboResultPlan1" multiple size="3"> <? while ($GetSelectedTypeRow = ibase_fetch_row($GetSelectedType_Result)) {//begin $SelectedQuotationSchemeName = $GetSelectedTypeRow[1]; if ($GetSelectedTypeRow[0] == $schemenumberSelected) {//begin $SetInitial = "selected"; }//end else {//begin $SetInitial = ""; }//end ?> <option value="<? echo $GetSelectedTypeRow[0]?>" <?echo $SetInitial?> > <? echo $GetSelectedTypeRow[1]?> </option> <?}?> </select> <select name="comboResultPlan" multiple size="3"> <? while ($GetSelectedTypeRow = ibase_fetch_row($GetSelectedType_Result)) {//begin $SelectedQuotationSchemeName = $GetSelectedTypeRow[1]; if ($GetSelectedTypeRow[0] == $schemenumberSelected) {//begin $SetInitial = "selected"; }//end else {//begin $SetInitial = ""; }//end ?> <option value="<? echo $GetSelectedTypeRow[0]?>" <?echo $SetInitial?> > <? echo $GetSelectedTypeRow[1]?> </option> <?}?> </select> _____

« previous php.general (#45099) next »