# How To enable and disable register button in registration form in FTL

**URL:** <https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387>\
**Category:** Miscellanaeous\
**Created:** [June 2, 2021, 9:20am UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387 "2021-06-02T09:20:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asperitas](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@Asperitas](https://forum.keycloak.org/u/Asperitas)\
**Post date:** [June 2, 2021, 9:20am UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/1 "2021-06-02T09:20:05Z")

</div>

hi,

i Want to disabled register button if the input field is empty on my registration page. after putting all the required inputs the register button will enabled.  
required inputs is checkbox, text box

if this behavior is possible from themes please provide me document for this.

thanking you

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [June 2, 2021, 10:15am UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/2 "2021-06-02T10:15:55Z")

</div>

You can do this with a custom theme. Documentation on creating a custom theme is here: [Server Developer Guide](https://www.keycloak.org/docs/latest/server_development/#_themes)

The input validation you’re suggesting is possible using javascript. You will have to customize the `register.ftl` template here: [keycloak/register.ftl at master · keycloak/keycloak · GitHub](https://github.com/keycloak/keycloak/blob/master/themes/src/main/resources/theme/base/login/register.ftl)

---

<div class="post-metadata">

**Author:** ![Asperitas](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@Asperitas](https://forum.keycloak.org/u/Asperitas)\
**Post date:** [June 2, 2021, 2:13pm UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/3 "2021-06-02T14:13:55Z")

</div>

Hi,  
thanks to you my button functionality is working good.  
is it possible to handle custom user attribute using displayMessage i.e. you provided method in above documents by keycloak.  
or we have to use external javascript only ?

Thanking you.

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [June 2, 2021, 4:21pm UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/4 "2021-06-02T16:21:30Z")

</div>

Sorry, but I don’t understand the question. If you want to add custom fields in the registration form, there are some examples in the documentation: [Server Developer Guide](https://www.keycloak.org/docs/latest/server_development/#modifying-extending-the-registration-form)

---

<div class="post-metadata">

**Author:** ![Asperitas](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@Asperitas](https://forum.keycloak.org/u/Asperitas)\
**Post date:** [June 3, 2021, 5:48am UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/5 "2021-06-03T05:48:44Z")

</div>

hi,

how we can add the required validations in theme only , or do we need to add the script to handle the custom attributes validations

Thanking you

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [June 3, 2021, 6:38am UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/6 "2021-06-03T06:38:19Z")

</div>

If you want the attributes to be validated on the frontend, you’ll have to write custom javascript. If you want to do it on the backend, you’ll have to write a custom `FormAction` and add it to the registration flow.

---

<div class="post-metadata">

**Author:** ![Asperitas](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@Asperitas](https://forum.keycloak.org/u/Asperitas)\
**Post date:** [June 4, 2021, 5:38am UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/7 "2021-06-04T05:38:11Z")

</div>

Hi,

How to add themes custom fields value in keycloak servers user attributes.

Thanking you.

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [June 4, 2021, 11:39am UTC](https://forum.keycloak.org/t/how-to-enable-and-disable-register-button-in-registration-form-in-ftl/9387/8 "2021-06-04T11:39:10Z")

</div>

Adding a custom field in the registration ftl is as simple as adding an input field with the naming convention `user.attributes.<field_name>`. For example, if you want to add a field for phone number, you could call it `user.attributes.phone` and that will store the value as a user attribute with key `phone`. There is a good example here: [https://keycloakthemes.com/blog/how-to-add-custom-field-keycloak-registration-page](https://keycloakthemes.com/blog/how-to-add-custom-field-keycloak-registration-page)
