A
Anonymous
May 19, 2020
Answered
Acrobat DC Javascript custom dialogue help
- May 19, 2020
- 3 replies
- 1900 views
- I am a complete newbie to JavaScript and this is my first post. With the help of various snippets of script I have found on the web and Thom Parker's book "all about pdf stamps" I have created a custom dialogue to populate several text fields and tick boxes of a dynamic stamp. The stamp works well but it could be better. I would like the input fields on the custom dialogue to display default values rather than blank white space. I can get one field to display as I would like, but only the last of 7 fields does this. If I copy what I did in field 7 to the others it doesn't work for the others but field 7 does work. Can you help? I have 7 lines like this:
- strField1: "",
- initialize: function(dialog) {
- dialog.load({"fld1":this.strField1});
- },
- These lines are repeated with strField1 and fld1 replaced by strField2 to strField7 and fld2 to fld7 followed by the following script:
- commit:function(dialog) {
- var data=dialog.store();
- this.strField1=data["fld1"];
- Again this is repeated for the other fields as before.
- I changed strField7:"", to strField7:"something else", and it defaults to "something else" instead of white space and the stamp works whether the custom dialogue default value is left or it is typed over. But it only works with this last field. If I do exactly the same thing with the others I still get the blank white input box but no default. I hope this makes sense and somebody can help me with this.
