Expand my Community achievements bar.

How to get data from one text field antoher - only if the first field has data

Avatar

Former Community Member

Hi,

I have a text field that gets data from one of two other text fields. That means if I enter data to TextField 1 data is populated into TextField 3. If I then enter data to TextField2 the data in TextField3 gets overwritten. This is fine as long as I actually enter data to TextField2. But if I just tab through TextField2 and leave it empty, TextField3 still gets this empty value.

How can I make TextField3 to only get data from TextField2 if TextField2 has a value? I suppose this can be done.

Right now I use this script on the Exit event of TextField1 and TextField 2 to populate TextField3.

TextField3.rawValue=this.rawValue;

Regards from a snow covered part of the planet.

Kirstine

2 Replies

Avatar

Level 9

Hello Kirstine,

In the exit event of TextField2 you can write the following script.

if(this.rawValue != null)

{

    TextField3.rawValue = this.rawValue;

}

Thanks.

Bibhu.

Avatar

Former Community Member

Thanks a lot, Bibhu.

It works perfect.

Kirstine