Elementor: Disabling a Form Field

Let’s say you have a form field where you have dynamic data being brought in and you don’t want users to edit that data. You could always make that a hidden field within the Elementor Form widget. However, if you want it to be shown to the user, you can add some JavaScript code to disable that form field. Below is the code for disabling a form field in Elementor:


<script>
document.getElementById("FIELD_ID").disabled = true;
</script>

Please note, that you will have to copy over the field ID into the JS code from your Elementor Form. Also, put “form-field-” before the actual ID. For example, if the ID of your field was “product-item“, then you would put “form-field-product-item” for the FIELD_ID in the JS code.

Other Helpful Articles

Smart Web Creative - Elementor: Create Conditional Form Fields with Code

Elementor: Create Conditional Form Fields with Code

If you ever wanted to create conditional form fields with code using Elementor Pro, this tutorial will guide you on how to do that. We will be using an example where users will be asked if they would like to enter their address details. It will look like this once

Read More »

What Do You Need Done?:

(Please check all that apply)

Tell Us About You

Almost Done!

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info