---
name: "[up-hide-for]"
area: "API"
kind: "HTML attribute"
parent: "up.form module"
url: "https://unpoly.com/api/up-hide-for"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.form module](https://unpoly.com/api/up.form.md)</nav>

# [up-hide-for]

Hides this element while an input field with [`[up-switch]`](https://unpoly.com/api/up-switch.md) has one of the given values.

The element will be shown for all other values.

<nav aria-label="Guides">

- [Learn: Switching form state](https://unpoly.com/learn/switching-form-state.md#toggle)

</nav>

---

## Modifying attributes {#attributes}

### [up-hide-for] {#up-hide-for}

(optional)

A list of input values for which this element should be hidden.

Multiple values can be separated by either a space (`foo bar`) or a comma (`foo, bar`).

If your values might contain spaces, you may also serialize them as a [relaxed JSON](https://unpoly.com/api/relaxed-json.md) array (`["foo", "bar"]`).

To react to the [presence or absence](https://unpoly.com/learn/switching-form-state.md#presence) of a value, use `:blank` or `:present`.

For [checkboxes](https://unpoly.com/learn/switching-form-state.md#checkboxes), you can react to `:checked` or `:unchecked` in addition to the checked value.

