Copy link to clipboard
Copied
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
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"]);
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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"]);
Copy link to clipboard
Copied
Your original script should have worked, too...
Copy link to clipboard
Copied
No,
my original script cleared both the fields....
Copy link to clipboard
Copied
Are those your actual field names?
Copy link to clipboard
Copied
yes, why? they are actual field names
Text1, Text2............... Text25
Copy link to clipboard
Copied
Then it should have worked.
Copy link to clipboard
Copied
no my original script didnot worked
this.getField("Text2").value = this.getField("Text1").value;
resetForm(["Text1"]);
The above script reset both the fields .... i wanted once the value was copied it should not reset,, but the above script reset both the fields
Copy link to clipboard
Copied
This script works.
Copy link to clipboard
Copied
My requirement was : I had two text fields and one button . I wanted the button to copy the value of first text field to second text field and reset the first field when the button is clicked.
below script didnot worked :
this.getField("Text2").value = this.getField("Text1").value;
resetForm(["Text1"]);
below script worked :
document level script:
function one()
{this.getField("Text2").value = this.getField("Text1").value;
}
this script in button:
one();
resetForm(["Text1"]);
Copy link to clipboard
Copied
Works just fine. See: Reset button test.pdf - Google Drive
Copy link to clipboard
Copied
yes, the original is also working but when i use it to my form it resets boths fields.. strange
Copy link to clipboard
Copied
If you want to share it (like I did, using something like Dropbox, Google Drive, Adobe Cloud, etc.), I'm happy to take a look at why it's not working.