Jump to content

Validation For Atleast One Field Filled


snookian

Recommended Posts

Hi guys, Im going insane with what im sure is a simple problem, I have a series of fields in a form. 2 of these fields however require on or both to be filled in, and if both are not then flag an error, but for the life of me I am having a coding blank and cant figure it out.

 

This is what i have conjured up so far, but as i have said im getting writers block and about to go insane.

if (!empty($field01) || !empty($field02)) {
 //???????????
    } else {
    echo '<p class="error">Please enter at least one field</p>';
}

 

 

Please any help would be greatly appreciated.

 

Ian

Link to comment
https://forums.phpfreaks.com/topic/271392-validation-for-atleast-one-field-filled/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.