# Clear values from txt field script

**URL:** <https://forum.inductiveautomation.com/t/clear-values-from-txt-field-script/5436>\
**Category:** Ignition\
**Created:** [November 16, 2012, 2:39pm UTC](https://forum.inductiveautomation.com/t/clear-values-from-txt-field-script/5436 "2012-11-16T14:39:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcorkern](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rcorkern](https://forum.inductiveautomation.com/u/rcorkern)\
**Post date:** [November 16, 2012, 2:39pm UTC](https://forum.inductiveautomation.com/t/clear-values-from-txt-field-script/5436/1 "2012-11-16T14:39:02Z")

</div>

I have an Alert pop page allowing a user to select tags and create an alert, this happens after selecting a Tag, Name, Location, setting alert type, etc… then clicking on a button to execute this. What script can I add to this button that will clear the values selected once the Alarm get created? (list and also text input fields as well as labels being passed from another window)?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [November 16, 2012, 3:55pm UTC](https://forum.inductiveautomation.com/t/clear-values-from-txt-field-script/5436/2 "2012-11-16T15:55:07Z")

</div>

Your script will simply set the property of each component to clear them out:`event.source.parent.getComponent("Text Field").text = ""`That will clear out a text field. You can do the same thing for other components but changing the property you want to clear out.

---

<div class="post-metadata">

**Author:** ![rcorkern](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rcorkern](https://forum.inductiveautomation.com/u/rcorkern)\
**Post date:** [November 16, 2012, 5:03pm UTC](https://forum.inductiveautomation.com/t/clear-values-from-txt-field-script/5436/3 "2012-11-16T17:03:33Z")

</div>

Ok cool that works except on the text boxes that are set to invisble when the button is clicked. How can I get those to clear out as well?

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [November 16, 2012, 6:02pm UTC](https://forum.inductiveautomation.com/t/clear-values-from-txt-field-script/5436/4 "2012-11-16T18:02:02Z")

</div>

It should still work even if the text box is invisible. Do you have a script that makes it visible somewhere that is also setting the value of the text property or something along those lines?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [November 16, 2012, 6:18pm UTC](https://forum.inductiveautomation.com/t/clear-values-from-txt-field-script/5436/5 "2012-11-16T18:18:59Z")

</div>

and you can set the visible property if you want as well:`event.source.parent.getComponent("Text Field").visible = 1`
