# Covert Action button to Text when Pushed

> In this example, we will use the equation value as the display for the action link, so we will set up a condition using IF to show the button text or the…

Source: https://tadabase.com/docs/snippets/covert-action-button-to-text-when-pushed  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

![Screenshot for “Covert Action button to Text when Pushed”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665599587475.png)

In this example, we will use the equation value as the display for the action link, so we will set up a condition using IF to show the button text or the message you’d like to show instead of the action link. Suppose the action link has already been clicked. You can set up your equation to show another field’s value or static values.

**Step 1**

**Set up your equation; you may use this as a reference.**

```
IF({Is Complete?}='Yes', CONCAT('The', CHAR(32), 'task', CHAR(32), 'has', CHAR(32), 'been', CHAR(32), 'completed!'), CONCAT('Set', CHAR(32), 'to', CHAR(32), 'complete'))
```

![Screenshot for “Covert Action button to Text when Pushed”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665598807818.png)

**Step 2**

**In your table component, set up the action link. Set the equation as the display value of the action link and set your CSS class to "act-link."**

![Screenshot for “Covert Action button to Text when Pushed”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665599014706.png)

**Step 3**

**Add the following code to the JavaScript tab of your page.**

```
TB.render('component_id', function(data) {
    var links = document.getElementsByClassName('act-link'),i = 1, temp, text, removeThis;
    var numLinks = links.length;
    while(i<numLinks){
        removeThis = links[i].getElementsByTagName("a")[0];
        removeThis.setAttribute("onClick", "window.location.reload();");
        text = removeThis.innerHTML;
        if(!text.contains("Set to complete")){
            removeThis.remove();
            temp = document.createElement('span');
            temp.innerHTML = text;
            links[i].appendChild(temp);
        }
        i++;
    }
});
```

![Screenshot for “Covert Action button to Text when Pushed”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665599340245.png)

> **Note:** Ensure you update the “**component_id**” to your table’s component ID.

For reference, you may find the component ID in the page builder by hovering over the info icon.

![Screenshot for “Covert Action button to Text when Pushed”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665599216791.png)

**Original Community Post:**

[Add an Option to the display rule - Community Discussions / How Do I - Tadabase Community](https://community.tadabase.io/t/add-an-option-to-the-display-rule/1314/2)
