# Conditional: Hide Div If Custom Field Is Empty

**URL:** <https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618>\
**Category:** How To\
**Created:** [September 30, 2022, 6:07pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618 "2022-09-30T18:07:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![SurgeLabs](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/surgelabs/32/4690_2.png) [@SurgeLabs](https://forum.bricksbuilder.io/u/SurgeLabs)\
**Post date:** [September 30, 2022, 6:07pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/1 "2022-09-30T18:07:54Z")

</div>

With the new Conditions Builder how would you hide a Div if a custom field is empty.

I’m using acf for custom fields and have a Parent div with two child div’s. One has static text and the other has dynamic text pulling from a custom field (location-phone). If the location-phone field is not empty the entire div should display. If empty the entire div should not show.

I attached a photo of what I’ve tried but its not working. Any thoughts or ideas.

![bricks-condition-2](https://forum.bricksbuilder.io/uploads/default/original/2X/1/1c3f0f5fbf5e1389680a7962a863adccf2408cee.jpeg)

---

<div class="post-metadata">

**Author:** ![lego2020](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/lego2020/32/4918_2.png) [@lego2020](https://forum.bricksbuilder.io/u/lego2020)\
**Post date:** [September 30, 2022, 6:17pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/2 "2022-09-30T18:17:14Z")

</div>

As @thomas said: This is just the beginning. I’m pretty sure that the conditions functionality will get much more features in the near future.

---

<div class="post-metadata">

**Author:** ![sleeplesskxng](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/sleeplesskxng/32/4060_2.png) [@sleeplesskxng](https://forum.bricksbuilder.io/u/sleeplesskxng)\
**Post date:** [September 30, 2022, 6:27pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/3 "2022-09-30T18:27:03Z")

</div>

Solution: Field != (quite literally leave empty)

 ![image](https://forum.bricksbuilder.io/uploads/default/original/2X/2/24d994716caac996829cabb15ae6e92db02be53d.png)

---

<div class="post-metadata">

**Author:** ![SurgeLabs](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/surgelabs/32/4690_2.png) [@SurgeLabs](https://forum.bricksbuilder.io/u/SurgeLabs)\
**Post date:** [September 30, 2022, 6:30pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/4 "2022-09-30T18:30:18Z")

</div>

Thanks for taking the time to help figure this out.

---

<div class="post-metadata">

**Author:** ![jornes](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/jornes/32/31340_2.png) [@jornes](https://forum.bricksbuilder.io/u/jornes)\
**Post date:** [October 1, 2022, 5:08am UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/6 "2022-10-01T05:08:35Z")

</div>

Yes.  
This is the same condition I am using for my site too, and it works.

---

<div class="post-metadata">

**Author:** ![digikraft](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/digikraft/32/5557_2.png) [@digikraft](https://forum.bricksbuilder.io/u/digikraft)\
**Post date:** [October 1, 2022, 7:17pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/7 "2022-10-01T19:17:23Z")

</div>

So Simple. Just tried it and it works. I was scratching my head about this for ages! Thanks

---

<div class="post-metadata">

**Author:** ![prj](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@prj](https://forum.bricksbuilder.io/u/prj)\
**Post date:** [May 17, 2023, 7:07pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/8 "2023-05-17T19:07:32Z")

</div>

Is there any way we can hide a container if a post widget is empty?

Basically if the metaquery is empty and so the post widget I want to hide the whole container.

The metaquery shows posts that share in comun a specific custom field value.

---

<div class="post-metadata">

**Author:** ![jornes](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/jornes/32/31340_2.png) [@jornes](https://forum.bricksbuilder.io/u/jornes)\
**Post date:** [May 26, 2023, 5:48pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/9 "2023-05-26T17:48:55Z")

</div>

I hope this condition helps.

Choose the container and set the condition based on this setting.  
 ![image](https://forum.bricksbuilder.io/uploads/default/original/2X/8/8ea78760c3b2c068a336df426670dd147d885a3c.png)

---

<div class="post-metadata">

**Author:** ![prj](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@prj](https://forum.bricksbuilder.io/u/prj)\
**Post date:** [May 27, 2023, 3:52am UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/10 "2023-05-27T03:52:08Z")

</div>

Hi Jornes, thanks!

In this case I’m using the post widget to check if two different post types share a specific ACF value in commun. I do all that with the meta query option but if I don’t get any results I would like to hide the container that includes those related posts (the container with the title, description and post widget).

I’m doing that with a small helper function but it would be nice to hide something if a specific widget is blank.

---

<div class="post-metadata">

**Author:** ![bjoern](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@bjoern](https://forum.bricksbuilder.io/u/bjoern)\
**Post date:** [November 16, 2023, 3:41pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/11 "2023-11-16T15:41:03Z")

</div>

Thanks! How is it possible to hide the heading if a JetEngine listing grid has no items?

---

<div class="post-metadata">

**Author:** ![prj](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@prj](https://forum.bricksbuilder.io/u/prj)\
**Post date:** [December 5, 2023, 1:05pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/12 "2023-12-05T13:05:35Z")

</div>

Vote it there!

> **[Your ideas and votes drive our development | Bricks Idea board](https://bricksbuilder.io/ideas/#7567)**
>
> Submit your feature request through our public idea board for others to upvote & comment on.

It is more useful than it seems

---

<div class="post-metadata">

**Author:** ![SSDesigns](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/ssdesigns/32/16640_2.png) [@SSDesigns](https://forum.bricksbuilder.io/u/SSDesigns)\
**Post date:** [January 15, 2024, 3:54pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/13 "2024-01-15T15:54:39Z")

</div>

![Screenshot 2024-01-15 at 12.49.43](https://forum.bricksbuilder.io/uploads/default/original/3X/2/5/25312461b4a54b2c00ebfb264ed11a97844be3af.png)

I have a DIV containing a header and values from a checkbox CPT created with JetEngine. I wanted to hide the DIV when there are no checkboxes selected in the post. Following the above instructions from this thread did not work for me. The DIV was not hiding even though no checkbox results were showing on the front end.

Reached out to support and Charaf suggested that since a value is outputted as ‘false’ when no checkboxes are selected, you need to type ‘false’ in the conditions section as shown in the screenshot.

If you have 5 checkboxes in your CPT, you will need to type false 5 times. e.g. false, false, false, false, false. If you have 10 checkboxes then you need to type false 10 times and so on.

This works when it comes to hiding elements that contain checkbox values.

---

<div class="post-metadata">

**Author:** ![prj](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@prj](https://forum.bricksbuilder.io/u/prj)\
**Post date:** [January 29, 2024, 9:49pm UTC](https://forum.bricksbuilder.io/t/conditional-hide-div-if-custom-field-is-empty/6618/15 "2024-01-29T21:49:53Z")

</div>

Did you find how to do it?
