Skip to main content
Inspiring
August 31, 2020
Answered

Add Text via Java Script

  • August 31, 2020
  • 1 reply
  • 735 views

Hi,

I do have a js-Script that adds three signature fields in my PDF. Now I'd like to have above a caption that says "Hereby I sign blah...".

How do I get that?

This topic has been closed for replies.
Correct answer try67

But this doesn't work:

 

this.addField("txtSignAN","text",0,[60,100,210,80]);
var varSignAN = this.getField("txtSignAN");
varSignAN.defaultValue = "Hereby blah";
varSignAN.editable = false;

 

The text field will be added, but the defaultValue isn't put in and editable is not set to false...


- You need to set the value property, too.

- There's no "editable" property. Use:

varSignAN.readonly = true;

1 reply

ls_rbls
Community Expert
Community Expert
August 31, 2020

If you're referring to a pop up notice use the app.alert() function. Otherwise, can you explain what you mean by a caption?  Is this something you need to make visible only the fields are created?

 

 

Lukas5E13Author
Inspiring
August 31, 2020

Basically I need just a non-changable text field.

Lukas5E13Author
Inspiring
August 31, 2020

But this doesn't work:

 

this.addField("txtSignAN","text",0,[60,100,210,80]);
var varSignAN = this.getField("txtSignAN");
varSignAN.defaultValue = "Hereby blah";
varSignAN.editable = false;

 

The text field will be added, but the defaultValue isn't put in and editable is not set to false...