Skip to main content
Inspiring
March 5, 2019
Answered

Create text with line break for clipboard

  • March 5, 2019
  • 1 reply
  • 621 views

Hello,

i have a form with 4 fields

a b c and d all with numbers to be filled.

now i want a button to copy the following to the clipboard with linebreak:

Text

"A"x Text

"B"x Text

"C"x Text

"D"x Text

Is this possible?

a textfield where i can mark this text and copy is almost ok for me.

This topic has been closed for replies.
Correct answer try67

Change the last line to:

event.value = text;

This script should be used as the custom calculation script of your target field.

1 reply

try67
Community Expert
Community Expert
March 5, 2019

It's not possible to place text in the clipboard directly, but you can certainly create a multi-line text field with a calculated value that the user can copy from.

emddummiAuthor
Inspiring
March 5, 2019

this is my script, but it doesnt work for me

var c_104c =  this.getField('104c').value;

var c_503b =  this.getField('503b').value;

var c_105c = this.getField('105c').value;

var c_110a = this.getField('110a').value;

var c_110c = this.getField('110c').value;

var text = c_104c + 'x L1.04C PGZ01\n' + c_503b + 'x L5.03B PGZ91';

antwortGF.setString(text);

i hope you can see what i mean....

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 5, 2019

Change the last line to:

event.value = text;

This script should be used as the custom calculation script of your target field.