# Custom form error messages: how to replace the field name?

**URL:** <https://forum.djangoproject.com/t/custom-form-error-messages-how-to-replace-the-field-name/25296>\
**Category:** Forms & APIs\
**Created:** [November 13, 2023, 3:01pm UTC](https://forum.djangoproject.com/t/custom-form-error-messages-how-to-replace-the-field-name/25296 "2023-11-13T15:01:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeremyG](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jeremyg/32/13496_2.png) [@JeremyG](https://forum.djangoproject.com/u/JeremyG)\
**Post date:** [November 13, 2023, 3:01pm UTC](https://forum.djangoproject.com/t/custom-form-error-messages-how-to-replace-the-field-name/25296/1 "2023-11-13T15:01:34Z")

</div>

Hi,

Currently, when a validation error message appears on my form, it looks like this:

```auto
* name_of_field
    * This field is mandatory.

```

Example:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/2/c/2cf72b585ee3bcafac2e60d643e60699f8b84416.png)

Is there a way to customize these messages?

I’d like to make it more like this:

```auto
* "What's your name?"
    * This field is mandatory.

```

“What’s you name?” being a label\_tag.

Thanks!

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 13, 2023, 4:03pm UTC](https://forum.djangoproject.com/t/custom-form-error-messages-how-to-replace-the-field-name/25296/2 "2023-11-13T16:03:11Z")

</div>

This actually depends upon whether you’re doing client-side or server-side validation for these fields.

If you’ve got client-side validation happening, see [Client-side form validation - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation#using_built-in_form_validation)

If you are performing server-side validation, then you can define these messages in your validators or using the [`error_messages`](https://docs.djangoproject.com/en/3.2/ref/forms/fields/#error-messages) attribute on the field definitions. (Also see [Creating forms from models | Django documentation | Django](https://docs.djangoproject.com/en/3.2/topics/forms/modelforms/#considerations-regarding-model-s-error-messages) when working with model forms.)
