Jump to content

Recommended Posts

Posted

Hello,

Got a simple need but couldn't find solution. I just want to check if a multiple checkbox have any value checked.

For sure this doesn't work because it's an array, but what it will be instead?

if ($page->date_sco == "1")  // this but for multiple

Thanks

Posted

I don't know of a multiple checkbox field. Is date_sco a page field? If yes, then:

if(count($page->date_sco)) {
}

// OR

if($page->date_sco->count) {
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...