# Toggle button confirmation

**URL:** <https://forum.inductiveautomation.com/t/toggle-button-confirmation/7240>\
**Category:** Ignition\
**Created:** [September 11, 2013, 5:45am UTC](https://forum.inductiveautomation.com/t/toggle-button-confirmation/7240 "2013-09-11T05:45:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat.stave](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@pat.stave](https://forum.inductiveautomation.com/u/pat.stave)\
**Post date:** [September 11, 2013, 5:45am UTC](https://forum.inductiveautomation.com/t/toggle-button-confirmation/7240/1 "2013-09-11T05:45:22Z")

</div>

Is it possible to use confirmation with the boolean toggle button?  
I know i can use confirmation with the 2 state toggle, but i can’t seem to replicate the visual styling of the boolean toggle on the 2 state toggle.

---

<div class="post-metadata">

**Author:** ![onestank](https://avatars.discourse-cdn.com/v4/letter/o/ba9def/32.png) [@onestank](https://forum.inductiveautomation.com/u/onestank)\
**Post date:** [September 16, 2013, 5:58pm UTC](https://forum.inductiveautomation.com/t/toggle-button-confirmation/7240/2 "2013-09-16T17:58:43Z")

</div>

You can script it like

```auto
if system.gui.confirm("Are you sure you want to change the scanner configuration?" , "Confirmation"):
	value = event.source.parent.parent.parent.fileExplorerSelected		
	system.tag.writeToTag('PL2/Line_Scanner/configfile', value)
```

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [September 25, 2013, 10:32pm UTC](https://forum.inductiveautomation.com/t/toggle-button-confirmation/7240/3 "2013-09-25T22:32:05Z")

</div>

Yes, you can add a confirm like onestank said, but the best way is to create a custom property that holds the bi-directional binding instead of your ‘selected’ property. That way you can use a property change script (based on the ‘selected’ property firing) with the system.gui.confirm() function to set your custom property to the new value of the ‘selected’ property.
