Issues Disabling Lookup and Number Fields via JavaScript

Hi everyone,

I'm trying to disable a lookup field and a number field using the following JavaScript code:

javascript

fd.field('{fieldName}').disabled = true;

However, I'm running into issues:

  1. Lookup Field: The UI correctly shows the field as disabled, but the browser's developer console displays an error message.
  2. Number Field: The UI does not disable the field at all, and the browser's developer console also shows an error message.

image

Is there a correct way to disable these types of fields via JavaScript? Any help or suggestions would be greatly appreciated.

Thanks!

Hello @Ari_Gunawan ,

you can do a workaround if it throws up errors in console.
Add the ".disabled" class to your element - data field (Looku).

In JS

$(".disabled").prop("disabled",true)

But as I can see in documentation, it should also work with .disabled.

Regards
Stepan