takn25 Posted February 8, 2011 Share Posted February 8, 2011 Hi i would like to know what is the best way to check if a textarea or an input box is empty. Is the empty function effective? Link to comment https://forums.phpfreaks.com/topic/227053-the-best-way-to-check-if-a-textarea-or-an-input-box-is-empty/ Share on other sites More sharing options...
sunfighter Posted February 10, 2011 Share Posted February 10, 2011 If you need to force the user to fill in these boxes then javascript is best to use before the form is submitted to the server. But you always need a backup plan for js. I use if(isset($_POST['id_name'])) but empty() does just as good a job i think. Link to comment https://forums.phpfreaks.com/topic/227053-the-best-way-to-check-if-a-textarea-or-an-input-box-is-empty/#findComment-1172142 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.