# Mutl-istate Button, Multi-Confirm Text

**URL:** <https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 22, 2022, 9:37pm UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486 "2022-03-22T21:37:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 22, 2022, 9:37pm UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486/1 "2022-03-22T21:37:48Z")

</div>

I would like to be able to change the Confirm Text based on the state that is to be changed to. How do I capture the selected state to conditionally set the Confirm Text property?

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [March 22, 2022, 11:59pm UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486/2 "2022-03-22T23:59:59Z")

</div>

I do not think this will work given the order you are desiring. You can give different responses based on the currently selected value, that would just require a binding that utilizes a case() expression and the Control Value property.

The confirm text popup will appear only after you have completed a click on the component. This action does not change the selected value, it instead prompts the popup to open. In that moment there is no information available about the value that is to be changed to, so you cannot change the text based on that.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [March 23, 2022, 2:47pm UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486/3 "2022-03-23T14:47:37Z")

</div>

You could possibly turn off the default confirmation and script your okay confirmation popup.

While have not tested or verified here is link to some custom jython boxes which i “think” will work in ignition

> **[Jython - Dialogs](https://www.tutorialspoint.com/jython/jython_dialogs.htm)**
>
> Jython - Dialogs, A Dialog object is a window that appears on top of the base window with which the user interacts. In this chapter, we shall see the preconfigured dialogs define

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [March 23, 2022, 3:09pm UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486/4 "2022-03-23T15:09:17Z")

</div>

I agree with andrews idea.

An Ignition function that may satisfy your use-case would be [system.gui.confirm()](https://docs.inductiveautomation.com/display/DOC81/system.gui.confirm). It creates a confirmation popup similar to the built-in component based one.

When the component is clicked, the Control Value property changes, so a propertyChange script can utilize the confirm() function to ask if the user to confirm the state that is to be changed to. The write action to the tag would be based on if the confirm() popup returns true when the user clicks yes.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 24, 2022, 1:05am UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486/5 "2022-03-24T01:05:17Z")

</div>

Best test that last… ):

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [March 24, 2022, 2:14pm UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486/6 "2022-03-24T14:14:33Z")

</div>

@pturmel care to share some bits of wisdom? (sad face was not very comforting lol)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 24, 2022, 3:19pm UTC](https://forum.inductiveautomation.com/t/mutl-istate-button-multi-confirm-text/57486/7 "2022-03-24T15:19:44Z")

</div>

Buttons that offer a built-in confirmation operation for a bidirectionally bound control value will change the control value after the confirmation. There is no way to defer the change to the control value with a hand-coded confirmation.

Just say no.

Use two buttons–one to set a “write-enabled” state, the other to perform the write (and optionally reset the state). This approach has the side benefit of not using any UI-freezing modal popups.
