So I have a select option list with values in it. But as with most select option lists the first one states dummy text for the user. The issue is that when the $_POST variable is carried over the isset value is true, but is there a way to make it false? Here is just an example. The bottom always echos true even if trying to use the dummy text. Frustrating or maybe I am doing this wrong? BTW THIS IS JUST EXAMPLE CODE
<?php
if(isset($_POST['curreny_pairs'])):
echo "true";
endif;
?>
<html>
<form action="blah" method="post">
<select name="currency_pairs" id="currency_pairs">
<option selected="selected">Currency Pair</option>
<option value="AUDCAD" >AUD/CAD</option>
<option value="AUDCHF" >AUD/CHF</option>
</select>
<input type="submit" value="submit">
</form>
</html>
Two Way
1) set value=”0″ for first option
and check with
empty()instead of isset() because2) use
disabledattribute for first optionand then you can check with
isset()