I have searched the net and this site but havent been able to find an answer.
I have a dropdown box which I need to get the text value of so I can perform some validation on it. I am working with a script which is already developed and I am modifying it so would like a simple fix.
When I call the request I am getting the categoryID (-1) and not the actual text value. The value isnt unique so I cant perform validation on this.
This is the code Im using and the details of the drop down.
<select id="catID" class="postform" name="cat"
$post_price_status2 = $_REQUEST['catID'];
if(trim($post_price_status2) == 'Select a Location') {
$catError = 'Please enter a price / select an Ad Typess.';
$hasError = true;
}
The drop down is also set to read only.
When you post data PHP look for name, not ID.
Change select name to be catID or change to $_REQUEST[‘cat’].