# Write value to text field on button click

**URL:** <https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [January 7, 2026, 12:35am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114 "2026-01-07T00:35:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul.patil](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@rahul.patil](https://forum.inductiveautomation.com/u/rahul.patil)\
**Post date:** [January 7, 2026, 12:35am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114/1 "2026-01-07T00:35:36Z")

</div>

Hi I am opening a window on button click. (visible = true)

On that window I want to set a value to a text field.

Can anyone please help?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 7, 2026, 12:47am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114/2 "2026-01-07T00:47:43Z")

</div>

Welcome to the forum. Please edit your question title and select Vision or Perspective from the tag dropdown. You've said "window" which implies Vision. (Perspective uses "views".)

Tip: the FAQ "Keep it tidy" section asks that we don't add signatures to posts. Your user name is applied automatically.

---

<div class="post-metadata">

**Author:** ![rahul.patil](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@rahul.patil](https://forum.inductiveautomation.com/u/rahul.patil)\
**Post date:** [January 7, 2026, 12:53am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114/3 "2026-01-07T00:53:02Z")

</div>

Thanks.

---

<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:** [January 7, 2026, 12:57am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114/4 "2026-01-07T00:57:12Z")

</div>

Please share more information about your application:

- Where does the string come from? A constant? A tag value? Some expression?

- Is the text field connected to something? Or unbound (for scripted custom handling)?

- Does the source of the field depend on the button that opens it? Where multiple buttons might open this window with different sources?

---

<div class="post-metadata">

**Author:** ![rahul.patil](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@rahul.patil](https://forum.inductiveautomation.com/u/rahul.patil)\
**Post date:** [January 7, 2026, 1:02am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114/5 "2026-01-07T01:02:10Z")

</div>

The string comes from the button that opens it.

That string is used to filter the data on window.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/6/3609a3f5a72d0ec798b56e966da7893894da8cb4.png)

Current button script:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/5/e5309a126d8e36c871abe42b1999d0906b2fcfc2.png)

---

<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:** [January 7, 2026, 1:06am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114/6 "2026-01-07T01:06:25Z")

</div>

That's not a window. You have a container pretending to be a window/template. You'd use `system.nav.openWindow()` to open a window.

Since it isn't a window, and therefore everything is in the same actual window, you can use layers of `.getComponent()` methods to reach that text field, and assign to its `.text` property.

Within your button script, you can use the property tool (on the right) to help you construct that set of methods.

---

<div class="post-metadata">

**Author:** ![rahul.patil](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@rahul.patil](https://forum.inductiveautomation.com/u/rahul.patil)\
**Post date:** [January 7, 2026, 1:13am UTC](https://forum.inductiveautomation.com/t/write-value-to-text-field-on-button-click/113114/7 "2026-01-07T01:13:10Z")

</div>

You are a legend!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/35d47f664770273a5fe9030f00edf08d60a63b15.png)

I got it.

I am an end user and learning the scripting in ignition.

@pturmel Thank you so much.
