dc_jt Posted January 13, 2010 Share Posted January 13, 2010 Hi I have a drop down box which lists months from 0 - 11 and also includes a "Please select..." option which value is set to "". However, when I submit the form with 0, it is not recognised as a value, therefore when I do if($_POST) this is not returned. Is there a way for $_POST to recognise 0 as a value rather than nothing? Hope that makes sense! Thanks Link to comment https://forums.phpfreaks.com/topic/188344-_post/ Share on other sites More sharing options...
dc_jt Posted January 13, 2010 Author Share Posted January 13, 2010 In plain english, if someone enters 0 I dont want if(!$_POST) to pick it up. Link to comment https://forums.phpfreaks.com/topic/188344-_post/#findComment-994293 Share on other sites More sharing options...
dc_jt Posted January 13, 2010 Author Share Posted January 13, 2010 Sorry, wrong forum. Can someone please move this to PHP Coding?? Link to comment https://forums.phpfreaks.com/topic/188344-_post/#findComment-994357 Share on other sites More sharing options...
DarkPrince2005 Posted January 13, 2010 Share Posted January 13, 2010 Try this if statement: if(isset($_POST) && $_POST['dropdown_name'] != "") Link to comment https://forums.phpfreaks.com/topic/188344-_post/#findComment-994359 Share on other sites More sharing options...
dc_jt Posted January 14, 2010 Author Share Posted January 14, 2010 Try this if statement: if(isset($_POST) && $_POST['dropdown_name'] != "") Thanks! Link to comment https://forums.phpfreaks.com/topic/188344-_post/#findComment-994750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.