cancel
Showing results for 
Search instead for 
Did you mean: 

Personas onChange Event Value

eedens
Participant
0 Kudos
1,129

This post from 2018 refers to the same issue I'm seeing. Is there a way to get the new value of a text field when using the onChange script event? The source.text value the event returns is the old value, which for field validation isn't really useful.

View Entire Topic
Brian_Wills
Contributor

Hi Elliott,

Here is the solution. When you look at the onChange event in the inspector it says:

It passes variables: source, oldValue and newValue.

You just need to use the variables. So create a script for the onChange event for the GuiTextField. Here is a snippet of code.

session.utils.log("onChange");

session.utils.log('oldValue =>' + oldValue);
session.utils.log('newValue =>' + newValue);

Every time you change the textfield value it displays the oldValue and newValue as expected. Easy as that. Hope this helps. FYI I'm using Personas 3.0 SP11.

Cheers,

Brian