troubleshooting Question

How can I see if at least one of these checboxes has been checked?

Avatar of Bruce Gust
Bruce GustFlag for United States of America asked on
4 Comments1 Solution42 ViewsLast Modified:
Here's my Contact form:

I want to ensure my user has selected at least one of the checkboxes. I know how to do it in JQuery, but I want to make use of the:

						<div class="alert alert-danger">
								@foreach($errors->all() as $error)
									<li>{{ $error }} </li>

Open in new window

...section of my blade, as opposed to a traditional "alert" box.


In the past, I've done something like this:

$data = request() -> validate([
			'name'=> 'required',
			'email' => 'required',
			'occupation' => 'required',
			'address_1' => 'required',
			'city' => 'required',
			'state' => 'required',
			'postal_code' => 'required',
			'country' => 'required',
			'phone' => 'required', 
			'comments' => 'required'

Open in new window

...which works fine, as far as validating the input fields, but it doesn't give me the freedom to check the boxes like I need to as far as ensuring at least one has been checked.

How can I pull this off?
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros