Skip to main content
Inspiring
November 2, 2023
Answered

reverse the contents of two fields

  • November 2, 2023
  • 1 reply
  • 1693 views

Hi
with the button I would like to run a script to insert into a button that allows me to reverse the contents of two fields called this.getField("SURNAME").value and this.getField("SURNAME_2").value
Please can someone help me?
Thank you

This topic has been closed for replies.
Correct answer Nesa Nurani

Use this in a button:

var s1 = this.getField("SURNAME");
var s2 = this.getField("SURNAME_2");
var ts1 = this.getField("SURNAME").value;
s1.value = s2.value;
s2.value = ts1;

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
November 2, 2023

Use this in a button:

var s1 = this.getField("SURNAME");
var s2 = this.getField("SURNAME_2");
var ts1 = this.getField("SURNAME").value;
s1.value = s2.value;
s2.value = ts1;
ENE5CD9Author
Inspiring
November 2, 2023

Thank you very much