Thanks for responding ixalmida,
I made the change you suggested, but no difference. Below are the results I get in my email:
Name: John Doe
Business Name: ABC Company
Email: john@doe.com
Phone: 222-222-2222
Preferred Method of Contact: Phone
Best Time to Call: 0
Comments: This is a test message from the email form.
I had selected 6am, 8am, and 11am as the best times to call when testing my form and all I get back is 0. Here is the block of code where I made the change you suggested, as well as other areas where it appears. Any further help you can provide is much appreciated.
//Check to make sure that the preferred time of contact field is selected
if(count($_POST['rt_preferredtime']) < 1) {
$preferredtimeError = 'Please select your preferred time of contact.';
$hasError = true;
} else {
$preferredtime = trim($_POST['rt_preferredtime']);
}
//If there is no error, send the email
if(!isset($hasError)) {
$phone=trim($_POST['rt_phone']);
$emailTo = ''.get_option('rttheme_form_mail').'';
$subject = 'Web Site Contact Request from '.$name;
$body = "Name: $name \n\nBusiness Name: $businessorg \n\nEmail: $email \n\nPhone: $phone \n\nPreferred Method of Contact: $preferredcontact \n\nBest Time to Call: $p \n\nComments: $comments";
$headers = 'From: '.$name.' <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;
mail($emailTo, $subject, $body, $headers);
$emailSent = true;
}
}
}
<li><label for="preferredtime">Best Time to Call: (*) <br> (You can select multiple times by holding down the Ctrl key <br> on your keyboard while you click.)</label>
<select id="preferredtime" name="rt_preferredtime[]"
value="<?php if(isset($_POST['rt_preferredtime'])) echo $_POST['rt_preferredtime'];?>" class="required" multiple="multiple" size="3">
<option value="6am">6am</option>
<option value="7am">7am</option>
<option value="8am">8am</option>
<option value="9am">9am</option>
<option value="10am">10am</option>
<option value="11am">11am</option>
<option value="12pm">12pm</option>
<option value="1pm">1pm</option>
<option value="2pm">2pm</option>
<option value="3pm">3pm</option>
<option value="4pm">4pm</option>
<option value="5pm">5pm</option>
<option value="6pm">6pm</option>
</select>
</li>