# Disabled Button Executes mouseClicked Event Handler

**URL:** <https://forum.inductiveautomation.com/t/disabled-button-executes-mouseclicked-event-handler/16577>\
**Category:** Ignition\
**Created:** [January 12, 2018, 5:57pm UTC](https://forum.inductiveautomation.com/t/disabled-button-executes-mouseclicked-event-handler/16577 "2018-01-12T17:57:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [January 12, 2018, 5:57pm UTC](https://forum.inductiveautomation.com/t/disabled-button-executes-mouseclicked-event-handler/16577/1 "2018-01-12T17:57:09Z")

</div>

I am using some standard push buttons to fire off scripts that perform database tasks.  
The buttons are enabled/disabled based on various conditions.  
When the buttons are disabled they still fire the mouseClicked event, where my scripts live.  
I found this old thread from 2010:

> [@Disabled button still working](http://forum.inductiveautomation.com/t/disabled-button-still-working/2390):
>
> I am using Ignition 7.1.8 (beta) and I set up security on several momentary buttons in my project. The button looks like it is disabling itself correctly when a user with the required role is not logged in. The background color changes to light gray. However, when I click on that button it is still writing a value to my PLC. I tried simply turning off the Enable property as a test and it does the exact same thing. The button is still working even though it is disabled! From what I found this onl…

In it the IA rep says the bug is fixed version 7.1.8.  
I'm using 7.9.4 and it is happening.  
Has anyone else seen this behavior? I am working around the problem by checking the enabled status of the button before running my scripts, but this shouldn't work this way.

Mike

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [January 12, 2018, 6:26pm UTC](https://forum.inductiveautomation.com/t/disabled-button-executes-mouseclicked-event-handler/16577/2 "2018-01-12T18:26:01Z")

</div>

Move the code to the action event.
