make field read only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:02 AM
Hello,
I've created a catalog item and need to set a field to read-only. I attempted to use an onLoad client script with:
However, this approach didn’t work.
The variable in question is a single-line text field and is not linked to a table field.
Do you know how I can achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:06 AM
@ammar_k - Please use the "Catalog UI Policy" to make a field Readonly, Mandatory or Visible, instead of client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:22 AM
Hi @ammar_k
Please use the Catalog UI Policy to make the variable readonly.
PLease mark my answer correct if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:35 AM
Are you sure that variable is not mandatory?
If it is mandatory then you cannot make it readonly
first make it non mandatory and then readonly
g_form.setMandatory('variable_name', false);
g_form.setReadOnly('variable_name', true);
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 05:16 AM