# name\_unique

Source: https://zotonic.com/docs/1748/name_unique

URI: https://zotonic.com/id/1748

Language: en



A [validator](/id/doc_developerguide_forms_and_validation#guide-validators) to check whether a resource’s name is unique:

```django
<input type="text" id="name" name="name" value="" />
{% validate id="name" type={name_unique} %}
```

Optionally, pass an `id` parameter to exclude that particular id when testing for uniqueness. This is useful when you want to exclude the name of the resource currently being edited:

```django
<input type="text" id="name" name="name" value="" />
{% validate id="name" type={name_unique id=id} %}
```

You can also pass a `failure_message`:

```django
<input type="text" id="name" name="name" value="" />
{% validate id="name" type={name_unique id=id failure_message=_"Eek! Already used!"} %}
```

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1748?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1748?language=en>)
