# How to prevent form submission (add new or edit)?

**URL:** <https://community.glideapps.com/t/how-to-prevent-form-submission-add-new-or-edit/64812>\
**Category:** Ask for Help\
**Created:** [August 8, 2023, 1:15pm UTC](https://community.glideapps.com/t/how-to-prevent-form-submission-add-new-or-edit/64812 "2023-08-08T13:15:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralf\_Westphal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf_westphal/32/61695_2.png) [@Ralf\_Westphal](https://community.glideapps.com/u/Ralf_Westphal)\
**Post date:** [August 8, 2023, 1:15pm UTC](https://community.glideapps.com/t/how-to-prevent-form-submission-add-new-or-edit/64812/1 "2023-08-08T13:15:41Z")

</div>

To prevent premature submission I can set entry fields to “required”. That’s great!

But what if not a single field should be filled in, but either field A or (!) field B? I cannot set both to “required”. Rather I need to check the condition manually and prevent submission as long as none of the fields are filled in.

How to do that? Maybe I can set up a calculated field checking the condition. But how to disable the submission buttons as long as this “is valid” field is false?

---

<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:** [August 8, 2023, 1:24pm UTC](https://community.glideapps.com/t/how-to-prevent-form-submission-add-new-or-edit/64812/2 "2023-08-08T13:24:32Z")

</div>

Set both to Required. Then set a visibility condition on Field A to only show if Field B is empty and vice versa. Once you start to fill one, it will hide the other. The Required flag is irrelevant when a component is hidden.

---

<div class="post-metadata">

**Author:** ![Ralf\_Westphal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf_westphal/32/61695_2.png) [@Ralf\_Westphal](https://community.glideapps.com/u/Ralf_Westphal)\
**Post date:** [August 8, 2023, 1:33pm UTC](https://community.glideapps.com/t/how-to-prevent-form-submission-add-new-or-edit/64812/4 "2023-08-08T13:33:36Z")

</div>

Thanks! That’s working nicely! 🥳

---

<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:** [August 15, 2023, 1:33pm UTC](https://community.glideapps.com/t/how-to-prevent-form-submission-add-new-or-edit/64812/5 "2023-08-15T13:33:38Z")

</div>

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