# Conditionally make hidden form field visible

**URL:** <https://community.noloco.io/t/conditionally-make-hidden-form-field-visible/227>\
**Category:** Feature Requests\
**Tags:** feature-request\
**Created:** [February 1, 2024, 9:16pm UTC](https://community.noloco.io/t/conditionally-make-hidden-form-field-visible/227 "2024-02-01T21:16:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buildwithjoel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.noloco.io/buildwithjoel/32/1537_2.png) [@buildwithjoel](https://community.noloco.io/u/buildwithjoel)\
**Post date:** [February 1, 2024, 9:16pm UTC](https://community.noloco.io/t/conditionally-make-hidden-form-field-visible/227/1 "2024-02-01T21:16:04Z")

</div>

**Context**

- See the image below as a reference for my example. At times, I’ve wanted to prefill a form field, such as a client’s Date of Birth. It should be filled with the Date of Birth field coming from the Clients table.
- However, sometimes this field will be empty, upon which it will need to be collected. So there’s my issue: if I make it hidden so that it passively collects the client’s Date of Birth, that’s great until they don’t already have a DOB value. In that case, the form will be submitted and the DOB will be empty.
- I’m getting around this with some workflows but ideally you could just conditionally display a hidden form field.

In other words, you could have a section in the window below that allows you to create rules that, if true, causes the field to display on the form. That way, if the client has a DOB in the system, it will be prefilled. Otherwise if the client doesn’t have a DOB in the system, the field will display.

**Method 1 - Conditionally display a hidden form field**

 ![Screenshot 2024-02-01 at 3.55.04 PM](https://europe1.discourse-cdn.com/flex005/uploads/noloco/original/1X/6a68e412a3f3279250f1e973e9ee66cac4b1fcec.png)

Here’s another possibility for approaching a feature that will fix this issue.

**Method 2 - Self-reference a field in conditional visibility**

- In this method, I would have my “Date of Birth” field set to have it’s default value be the client’s date of birth. Easy. But then the field is sitting there visibly, with a pre-filled value which is just ugly and, depending on your use-case, unacceptable if that datapoint needs to be hidden. So I went to conditionally display that field only if there is NO default value. But I found you can’t do that… yet 🙂

 ![Screenshot 2024-02-01 at 3.58.04 PM](https://europe1.discourse-cdn.com/flex005/uploads/noloco/original/1X/abfe1ffd69c7e431ec27000527f20f6b753e4ef7.png)

---

<div class="post-metadata">

**Author:** ![onlymatt](https://avatars.discourse-cdn.com/v4/letter/o/48db29/32.png) [@onlymatt](https://community.noloco.io/u/onlymatt)\
**Post date:** [September 24, 2024, 1:26pm UTC](https://community.noloco.io/t/conditionally-make-hidden-form-field-visible/227/2 "2024-09-24T13:26:16Z")

</div>

I’ve run into this situation many times as well. I’d say more broadly I’d like to see the ability to conditionally set default values.

---

<div class="post-metadata">

**Author:** ![lukebranford](https://dub1.discourse-cdn.com/flex005/user_avatar/community.noloco.io/lukebranford/32/32_2.png) [@lukebranford](https://community.noloco.io/u/lukebranford)\
**Post date:** [October 2, 2024, 8:31am UTC](https://community.noloco.io/t/conditionally-make-hidden-form-field-visible/227/3 "2024-10-02T08:31:13Z")

</div>

Just realised this is very close to my request here: [Conditional hidden field](https://community.noloco.io/t/conditional-hidden-field/1284)
