For each field in your form: if($field1) { $checkint++; } Then, at the end: if($checkint != "" || $checkint != "13") { echo("You must complete either all or none of the fields!"); } Hth, -m