Quantcast
Channel: Adobe Community: Message List - PDF Forms
Viewing all articles
Browse latest Browse all 57214

Re: Copy input text to another field

$
0
0

You can use a script like the following for the custom calculate script for the E text field:

 

(function () {

 

    // Get the values from the input fields, as strings

    var s1 = getField("A").valueAsString;

    var s2 = getField("B").valueAsString;

    var s3 = getField("C").valueAsString;

    var s4 = getField("D").valueAsString;

 

    var s = "";

 

    if (s1) s+= s1 + "\r";

    if (s2) s+= s2 + "\r";

    if (s3) s+= s3 + "\r";

    if (s4) s+= s4;

 

})();

 

This separates each field value with a single carriage return (\r), so field E should be set to multiline. There's a potential for the last character to be a carriage return, and if you want to prevent this the code would have to be changed slightly.


Viewing all articles
Browse latest Browse all 57214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>