---
title: "Power Scripts: Disable rich text fields without collapsing them"
canonical: "https://support.appfire.com/space/SUPPORT/670796256/Power%20Scripts%3A%20Disable%20rich%20text%20fields%20without%20collapsing%20them"
format: markdown
---
Power Scripts comes with the[https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480350](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480350)routine, which is useful for disabling users from editing issue fields in both:

- Edit Issue view
- A transition screen

However, the[https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480350](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480350)routine can cause issues with rich text fields, as it collapses them. 

Use the following steps to disable users in rich text fields without collapsing them.

## \uD83D\uDCD8 Instructions

Instead of using the `IfDisable` routine, you can use the[https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480977](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480977) routine to control the behavior of rich text fields while disabling them in the process. The scripts below work for the `environment` field when editing an issue, and include a description of each line:

```
AJS.$("#environment").attr("disabled", "disabled");
AJS.$("#edit-issue-submit").on("click", function() { AJS.$("#environment").removeAttr("disabled"); } )
AJS.$("#environment").parent().parent().children(".wiki-edit-toolbar").remove();
```

1. The first line prevents the user from editing the field.
2. Disabling the field prevents that field from being set when clicking to save the issue or submit a screen to progress through a transition. As such, to maintain the existing value, you’ll need to re-enable it when the user saves the changes made to the issue.
3. This line also removes the controls from the rich text field, so that the user cannot manipulate formatting even when it’s disabled.

> ℹ️ Note: `IfExecuteJS` is a frontend-based solution, so users with sufficient JavaScript knowledge can still edit the field.

## \uD83D\uDCCB Related articles

[https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480684](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480684) 

> Macro (contentbylabel)