# Perspective - Text Field onCompositionEnd

**URL:** <https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 6, 2020, 11:04am UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448 "2020-08-06T11:04:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [August 6, 2020, 11:04am UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/1 "2020-08-06T11:04:25Z")

</div>

i am trying to get the updated text from a text field when a user changes the text so that I can update that data in the database.

I cannot seem to find an event that works for this.

- If I use a change script on props.text. That event fires whenever i load new records or change records.

- If I use the onCompsitionEnd or onCompositionUpdate, these events don’t seem to be firing.

I’d really prefer not to have some pesky save button that users forget to push.

---

<div class="post-metadata">

**Author:** ![Walt](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Walt](https://forum.inductiveautomation.com/u/Walt)\
**Post date:** [October 1, 2020, 4:21pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/2 "2020-10-01T16:21:35Z")

</div>

Did you ever get this working? I would like to do something similar.

---

<div class="post-metadata">

**Author:** ![rberghammer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rberghammer/32/7150_2.png) [@rberghammer](https://forum.inductiveautomation.com/u/rberghammer)\
**Post date:** [November 17, 2020, 4:20pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/3 "2020-11-17T16:20:21Z")

</div>

Bumping this thread because I’m having the same issue in 8.1. I can’t get any onComposition events to fire. Are these events intended to fire when the user changes the value of a text field?

Using a change script is not ideal in my situation because I only want the script to execute when the value is changed from the text field (not other sources).

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 17, 2020, 6:43pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/4 "2020-11-17T18:43:43Z")

</div>

First things first:  
The `onCompositionXXX` Events are used to accommodate languages which do not use “latin” characters, so don’t expect these events to help you in this situation.

After wracking my brain trying to find a way to manage this and thinking there must be an easy way, I reached out to Dev and was reminded that there IS INDEED AN EASY WAY.

In the onChange script, specify that you only take an action if the origin is the browser:

```auto
if origin == 'Browser':
    # update database

```

This will result in the update only taking place if the “user” has changed the value, as opposed to a “Binding” or “Script”.

---

<div class="post-metadata">

**Author:** ![rberghammer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rberghammer/32/7150_2.png) [@rberghammer](https://forum.inductiveautomation.com/u/rberghammer)\
**Post date:** [November 18, 2020, 1:33am UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/5 "2020-11-18T01:33:36Z")

</div>

Thanks! That works perfectly.

I would recommend updating the documentation for the `onCompositionXXX` events. [This page](https://docs.inductiveautomation.com/display/DOC80/Perspective+Event+Types+Reference) says:

> `onCompostionUpdate:` Triggers when a new character is received while composing text on an input component

This really sounds like it is meant to update while the user is typing.

---

<div class="post-metadata">

**Author:** ![coyne.32](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@coyne.32](https://forum.inductiveautomation.com/u/coyne.32)\
**Post date:** [November 27, 2020, 8:46pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/6 "2020-11-27T20:46:09Z")

</div>

Wanted to bump this, since I'm running into the same frustrations with a Dropdown component. Since the Dropdown also has the ability to enter custom text (if **allowCustomOptions** is enabled), I thought I'd be able to use the onCompositionEnd event if the user manually enters text to open a popup for her/him to confirm whether to add the new value to the database.

The proposed solution to filter on:

> [@cmallonee](#):
>
> if origin == 'Browser': # update database

isn't as straightforward for the Dropdown, since the props.value field would also be changed by the browser when a user selects an existing option. In this case, I also need to filter out numeric values and 'null', which is what is set after clearing. I'm sure this solution will work, but just seems like kind of a kludgy workaround.

Like @rberghammer, I'd recommend either clarifying this in the documentation or fixing it so the events fire as expected.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 28, 2020, 5:58pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/7 "2020-11-28T17:58:30Z")

</div>

I’ll reach out to the documentation team, but to be clear: the Events do fire as expected - they’re just not being used as they are intended to be used.

---

<div class="post-metadata">

**Author:** ![Dbenners](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dbenners](https://forum.inductiveautomation.com/u/Dbenners)\
**Post date:** [December 5, 2020, 2:40pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/8 "2020-12-05T14:40:10Z")

</div>

I’ve been using the Focus Events / onBlur event to trigger scripts. When the field loses focus ( tab or click off of it) the script runs.

---

<div class="post-metadata">

**Author:** ![tmahaffey](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tmahaffey/32/30949_2.png) [@tmahaffey](https://forum.inductiveautomation.com/u/tmahaffey)\
**Post date:** [February 22, 2021, 10:50pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/9 "2021-02-22T22:50:30Z")

</div>

I’ll weigh in on this too. I’m not finding anything called an ‘onChange’ script for the text field component.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0bde2b7e895916e853972210dd74888f44e979ff.png)  
I guess I will just have to do some scripting for the onKeyPress that registers if they hit enter, then take the text and do my intended action.

It would be nice if these text components had a selected property too.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 22, 2021, 11:09pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/10 "2021-02-22T23:09:23Z")

</div>

> [@tmahaffey](#):
>
> I’m not finding anything called an ‘onChange’ script for the text field component

The "change script" is accessed by right-clicking the property which might change and selecting "Add Change Script" from the context menu. "Change" scripts are not a component-interaction event, so they're in a different location.

 ![Screen Shot 2021-02-22 at 3.08.38PM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1fcfa7dc2527ed99e07a86ea91c7c50005d99b3.png)

> [@tmahaffey](#):
>
> It would be nice if these text components had a selected property too.

You're looking for `onFocus`.

---

<div class="post-metadata">

**Author:** ![tyler.robertson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tyler.robertson/32/18299_2.png) [@tyler.robertson](https://forum.inductiveautomation.com/u/tyler.robertson)\
**Post date:** [October 31, 2025, 1:57pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/11 "2025-10-31T13:57:01Z")

</div>

Bumping because I hate that I keep forgetting onCompositionxxx is not what I think it is

---

<div class="post-metadata">

**Author:** ![n099y](https://avatars.discourse-cdn.com/v4/letter/n/258eb7/32.png) [@n099y](https://forum.inductiveautomation.com/u/n099y)\
**Post date:** [February 10, 2026, 12:30am UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/12 "2026-02-10T00:30:09Z")

</div>

How are they intended to be used?

I cannot put any form of script in that event and get it to fire. Tried all sorts of different character sets.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 10, 2026, 4:18pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-oncompositionend/37448/13 "2026-02-10T16:18:15Z")

</div>

You can read more about it here: [Element: compositionend event - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event) The quick example provided there deals with when a user is applying the `option` or `windows` key along with typed characters.
