# Trigger a button Click with text entry

**URL:** <https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [August 7, 2020, 3:31pm UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507 "2020-08-07T15:31:57Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![sagar.iparkar](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sagar.iparkar](https://forum.inductiveautomation.com/u/sagar.iparkar)\
**Post date:** [September 16, 2022, 6:33am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/21 "2022-09-16T06:33:08Z")

</div>

Below code how can implement in perspective ?Can you please give any example for implementation ?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 16, 2022, 7:29am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/22 "2022-09-16T07:29:35Z")

</div>

You would most likely want to add a custom method onto your button or a custom function into a script library, then you’ll be able to call that method/function from your other component using something like:

```auto
self.parent.parent.getChild("Button").your_method_name(arg1, arg2)

```

---

<div class="post-metadata">

**Author:** ![sagar.iparkar](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sagar.iparkar](https://forum.inductiveautomation.com/u/sagar.iparkar)\
**Post date:** [September 16, 2022, 7:39am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/23 "2022-09-16T07:39:16Z")

</div>

Thanks 🙂  
Can we use this method in ignition perspective for file upload component to reset using script?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 16, 2022, 7:45am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/24 "2022-09-16T07:45:18Z")

</div>

Are you talking about clearing the uploads? You can just call the component’s `clearUploads()` method  
[https://docs.inductiveautomation.com/display/DOC81/Perspective+-+File+Upload](https://docs.inductiveautomation.com/display/DOC81/Perspective+-+File+Upload)

---

<div class="post-metadata">

**Author:** ![sagar.iparkar](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sagar.iparkar](https://forum.inductiveautomation.com/u/sagar.iparkar)\
**Post date:** [September 16, 2022, 7:49am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/25 "2022-09-16T07:49:02Z")

</div>

self.getSibling(“FileUpload”).clearUploads()

showing below error :AttributeError: ‘com.inductiveautomation.perspective.gateway.script’ object has no attribute ‘clearUploads’

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 16, 2022, 7:51am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/26 "2022-09-16T07:51:03Z")

</div>

Looks like that method was only added in v8.1.18

---

<div class="post-metadata">

**Author:** ![sagar.iparkar](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sagar.iparkar](https://forum.inductiveautomation.com/u/sagar.iparkar)\
**Post date:** [September 16, 2022, 7:53am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/27 "2022-09-16T07:53:15Z")

</div>

Can you please share that function implementation any ref code ?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 16, 2022, 8:43am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/28 "2022-09-16T08:43:41Z")

</div>

Unfortunately you’re going to have to upgrade to get that method available to you

---

<div class="post-metadata">

**Author:** ![sagar.iparkar](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sagar.iparkar](https://forum.inductiveautomation.com/u/sagar.iparkar)\
**Post date:** [September 16, 2022, 8:58am UTC](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507/29 "2022-09-16T08:58:12Z")

</div>

Thank you for giving me this information.

[Previous page](https://forum.inductiveautomation.com/t/trigger-a-button-click-with-text-entry/37507.md?page=1)
