# How to conditionally disable any field using a toggle field?

**URL:** <https://forum.getkirby.com/t/how-to-conditionally-disable-any-field-using-a-toggle-field/30754>\
**Category:** Questions\
**Tags:** v4\
**Created:** [February 10, 2024, 12:11pm UTC](https://forum.getkirby.com/t/how-to-conditionally-disable-any-field-using-a-toggle-field/30754 "2024-02-10T12:11:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 10, 2024, 12:24pm UTC](https://forum.getkirby.com/t/how-to-conditionally-disable-any-field-using-a-toggle-field/30754/2 "2024-02-10T12:24:35Z")

</div>

The problem is that the `disabled` prop doesn’t support query language out of the box. So you need a custom field that overwrites the `disabled` prop, as I suggested in this thread: [Dynamic default number field - #2 by texnixe](https://forum.getkirby.com/t/dynamic-default-number-field/30562/2)

Keep in mind that this does not work on the fly, for changes of the toggle field to reflect for the field that depends on this value, you need to save the page and reload. Because loading of the blueprint happens on the server side.

Or you would have to create a custom field that works similarly to the slug field and listens to changes on the frontend.

> [@asbiot](#):
>
> ```auto
> disabled:
> when: 
> toggle: true
> 
> ```

This cannot possibly work, because `when` is a field property, not an field option property.

---

_[View the full topic](https://forum.getkirby.com/t/how-to-conditionally-disable-any-field-using-a-toggle-field/30754)._
