Ignition Perspective 8.1.48-One shot button is disable still executes the scripts

I am using a One Shot Button to perform a calculation. There are several input fields, and I want the Calculate button to be enabled or disabled based on the user's input activity.

For example, if a user is entering a value in an input field, the Calculate button should remain disabled until the field loses focus (on blur).

Currently, my logic correctly disables the button while the user is editing a field. However, when I click the Calculate button, the calculation still executes, and the button becomes enabled. This appears to be a race condition between the field's blur event and the button's action execution.

Do you have any suggestions on how to achieve this?

Tip: edit your question title and add the Ignition version and module (Vision or Perspective) tags. It looks like you're asking about Vision.

It is Ignition perspective version 8.1.48.

The tags are in a dropdown below the title. I've added them in. It helps you get attention from folks who watch particular tags.

Make sure that you are using onActionPerformed event and not the onClick event.

  • onActionPerformed will respect the button's Enabled property.
  • onClick doesn't. The event will fire even if Enabled: false.

The code was initially implemented in the onActionPerformed event, but it wasn't working as expected. I have now moved the logic to the onClick event. but No luck.

Calculate code is in custom method and I am calling that custom method On "On Click" or onActionPerformed event

As @Transistor says, the "On Click" event does not check the enabled prop. Only the actionPerformed event will meet your requirement.

okay, let me try again.
Thanks!!