# Make a component required or optional based on a certain condition

**URL:** <https://community.glideapps.com/t/make-a-component-required-or-optional-based-on-a-certain-condition/59648>\
**Category:** Ask for Help\
**Created:** [March 25, 2023, 12:28am UTC](https://community.glideapps.com/t/make-a-component-required-or-optional-based-on-a-certain-condition/59648 "2023-03-25T00:28:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)\
**Post date:** [March 25, 2023, 12:28am UTC](https://community.glideapps.com/t/make-a-component-required-or-optional-based-on-a-certain-condition/59648/1 "2023-03-25T00:28:00Z")

</div>

Is there a way to make a component ‘required’ if a certain condition is met? I see there is a check box to specify if a component is required or not but is there a way to make it required in certain cases and optional in other cases?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 25, 2023, 12:33am UTC](https://community.glideapps.com/t/make-a-component-required-or-optional-based-on-a-certain-condition/59648/2 "2023-03-25T00:33:25Z")

</div>

If you hide the component via a visibility condition, then you can still submit the form with that value being empty. If you still need the component to be visible, then I would suggest creating two components. One that is required, and one that is not. Then show either one depending on which condition needs to be met to make it visible/required or not.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [March 26, 2023, 12:33am UTC](https://community.glideapps.com/t/make-a-component-required-or-optional-based-on-a-certain-condition/59648/3 "2023-03-26T00:33:41Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
