jamiller
11-15-2007, 02:56 PM
So I'm building a rather simple contact form and everything is working correctly except my dropdowns.
HTML:
<select name="requestType">
<option value="default" selected="yes">Select a Request Type</option>
<option value="salesRep">Speak to a Sales Rep</option>
<option value="generalInfo">General Information</option>
</select>
I've only included this select because as I said, everything else on the form (simple inputs) are being passed and error checked successfully.
My question is how do I check to see if the default value has been selected, in my case it's "Select a Request Type" or a valid option like salesRep?
The form is posting to sendContact.php and from there I have:
$requestType = $_REQUEST['requestType'];
if($requestType == "default") {
header('Location: contact.php?sent=no');
}
If I include $requestType in the email that I send I get "Select a Request Type" rather than "default" so I even tried if($requestType == "Select a Request Type") but it still didn't work.
Anybody have any ideas? Thanks for any and all help!
Jeff
HTML:
<select name="requestType">
<option value="default" selected="yes">Select a Request Type</option>
<option value="salesRep">Speak to a Sales Rep</option>
<option value="generalInfo">General Information</option>
</select>
I've only included this select because as I said, everything else on the form (simple inputs) are being passed and error checked successfully.
My question is how do I check to see if the default value has been selected, in my case it's "Select a Request Type" or a valid option like salesRep?
The form is posting to sendContact.php and from there I have:
$requestType = $_REQUEST['requestType'];
if($requestType == "default") {
header('Location: contact.php?sent=no');
}
If I include $requestType in the email that I send I get "Select a Request Type" rather than "default" so I even tried if($requestType == "Select a Request Type") but it still didn't work.
Anybody have any ideas? Thanks for any and all help!
Jeff