Skip to main content
rakeshk21205956
Inspiring
March 14, 2018
Answered

Pdf form script to clear a text field and copying value with same button.

  • March 14, 2018
  • 1 reply
  • 4133 views

I want a single button in pdf form to perform the below task:

Copy the value of the first text field to second field and  then reset the first field without changing the value of second field to which the original value was copied.

I used the following script but it resets the both fields;

first field = Text1;

Second field = Text2;

script:

this.getField("Text2").value = this.getField("Text1").value;

resetForm(["Text1"]);

thanks

This topic has been closed for replies.
Correct answer rakeshk21205956

sorry for disturbing... finally i got it working. with below script :

document level script:

function one()

{this.getField("Text2").value = this.getField("Text1").value;

}

this script in button:

one();

resetForm(["Text1"]);

1 reply

rakeshk21205956
Inspiring
March 14, 2018

I also tried the below script :

function one()

{

this.getField("Text2").value = this.getField("Text1").value;

}

resetForm(["Text1"]);

but this also didnot worked.. it cleared both fields.

rakeshk21205956
rakeshk21205956AuthorCorrect answer
Inspiring
March 14, 2018

sorry for disturbing... finally i got it working. with below script :

document level script:

function one()

{this.getField("Text2").value = this.getField("Text1").value;

}

this script in button:

one();

resetForm(["Text1"]);

try67
Braniac
March 14, 2018

yes, why? they are actual field names

Text1, Text2............... Text25


Then it should have worked.