Hi all, Any of you who wants an easy and dynamic solution for required form fields here is a simple solution: http://www.dynamicdrive.com/dynamicindex16/requiredcheck.htm
Regards Sinbad
Just make sure you verify that the data is coming from your server and someone hasn't submitted it from their server.
Javascript can be turned off. You shouldn't be relying on that for form verification....
I know its not the perfect solution, but i have seen so many requests for help with required form fields , and i thought this is a quick fix and may help some members here especially if the validation is mainly concerned with empty fields.
$fields = array('field1', 'field2', 'field3', 'field4'); foreach($fields as $f) { if(empty($_POST[$f])) { die("You must fill in the ".$f." field"); } }