I have an html form with the following dropdown menu and a text area for notes:
<select name='delplace' id='delplace'>
<option value=''></option>
<option value="Fulfillment">Leave for pickup in fulfillment</option>
<option value="OrderersDesk">On orderer's desk</option>
<option value="Fishbowl">Fishbowl</option>
<option value="DiningRoom">Dining Room</option>
<option value="International Room">International Room</option>
<option value="3rdFloorConferenceRoom">3rd Floor Conference Room</option>
<option value="FedEx">FedEx - see Notes below</option>
<option value="UPS">UPS - see Notes below</option>
<option value="USMail">US Mail - see Notes below</option>
<option value="Other">Other - see Notes below</option></select>
<p>DELIVERY NOTES: <br />
(Please enter address here if you have selected a shipping option, or have special delivery instructions)<br></p>
<textarea class=mainForm name=delnotes id=delnotes rows=5 cols=50></textarea>
I'm trying to customize the php code to process this form with conditional statemnts, so if someone selects any of the last four options in the dropdown menu, then the text area becomes a required field.
if(trim($place) == '') {
echo '<div class="error_message">Attention! Please select a valid delivery location.</div>';
exit();
} else if(($place) == "FedEx" || ($delnotes) == '') {
echo '<div class="error_message">Attention! Please provide more information in delivery notes area.</div>';
exit();
} else if(($place) == "UPS" || ($delnotes) == '') {
echo '<div class="error_message">Attention! Please provide more information for UPS in delivery notes area.</div>';
exit();
}else if(($place) == "USMail" || ($delnotes) == '') {
echo '<div class="error_message">Attention! Please provide more information for US Mail in delivery notes area.</div>';
exit();
} else if(($place) == "Other" || ($delnotes) == '') {
echo '<div class="error_message">Attention! Please provide more information in delivery notes area.</div>';
exit();
}
It works with one item only, but not with multiple items... Any suggestions on what I'm doing wrong here? I'm wracking my brain over this one!