Jump to content

Validate at least one checkbox selected


aldrin151

Recommended Posts

Hello everyone...I'm having a bit of a problem with validating a group of checkboxes...for example I have

 

$fldalgebra_checkbox

$fldcalculus_checkbox

$fldgeometry_checkbox

$fldtrigonometry_checkbox

 

At least one of these fields need to be checked for the form not to generate any FormErroMessage "Please check at least one of these fields".

 

I tried if ($fldalgebra_checkbox != "1" || $fldcalculus_checkbox != "1"){

$sEditInterestsErr .= "Please check at least one of these fields.</br>";

}

 

This doesn't work for obvious reasons...Can someone help me use a method that works?

 

Regards

 

Aldrin  :)

 

Link to comment
https://forums.phpfreaks.com/topic/112817-validate-at-least-one-checkbox-selected/
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.