Skip to main content
arunas36741820
Participating Frequently
July 5, 2016
Answered

Dynamic Stamp with multiple input from option buttons to be filled into the checkbox!

  • July 5, 2016
  • 12 replies
  • 5382 views

I'm trying the below code to get a stamp with the multiple input. Based on the selection of option buttons, I require the stamp to be updated. I'm unable to find the error. Could someone help pl.

This topic has been closed for replies.
Correct answer try67

I placed the stamp on PDF and ... in console I gave the    this.selectedAnnots[0].AP  ....

this is the stamp name

#pfP__PjJ7SwG7RRWsGspWA ...


OK, that's fine.

I think the issue is that you defined the dialog object after the code where you're calling it. You should move the definition of DiaBox to the top of the code.

12 replies

Participating Frequently
March 13, 2018

I have an error :

TypeError: this.getField(...) is null

115:App:Calculate

Karl Heinz  Kremer
Community Expert
Community Expert
March 13, 2018

Check your line #115, you are trying to reference a field that does not

exist.

arunas36741820
Participating Frequently
July 5, 2016

if(event.source.forReal && (event.source.stampName == "#pfP__PjJ7SwG7RRWsGspWA"))

{

if ("ok" == app.execDialog(DiaBox))

{

this.getField("Approved - Submit Final Copies").checkThisBox(0, DiaBox.bChk1);

this.getField("Approved as commented - Resubmit").checkThisBox(0, DiaBox.bChk2);

this.getField("Not Approved - Resubmit").checkThisBox(0, DiaBox.bChk3);

this.getField("Cleared for Manufacture").checkThisBox(0, DiaBox.bChk4);

this.getField("For Information").checkThisBox(0, DiaBox.bChk5);

var cMsg = DiaBox.byName;

event.value = "Remarks # " + cMsg;

event.source.source.info.exhibit = cMsg;

}

}

var DiaBox =

{

result:"cancel",

DoDialog: function(){return app.execDialog(this);},

bChk1:true,

bChk2:false,

bChk3:false,

bChk4:false,

bChk5:false,

stredt1:"",

initialize: function(dialog)

{

var dlgInit =

{

"Chk1": this.bChk1,

"Chk2": this.bChk2,

"Chk3": this.bChk3,

"Chk4": this.bChk4,

"Chk5": this.bChk5,

"Name": this.stredt1,

};

dialog.load(dlgInit);

},

commit: function(dialog)

{

var oRslt = dialog.store();

this.bChk1 = oRslt["Chk1"];

this.bChk2 = oRslt["Chk2"];

this.bChk3 = oRslt["Chk3"];

this.bChk4 = oRslt["Chk4"];

this.bChk5 = oRslt["Chk5"];

this.byName = oRslt["Name"];

},

description:

{

name: "Stamp",

elements:

[

{

type: "view", elements:

[

{

type: "view",

char_height: 10,

elements:

[

{

type: "static_text",

item_id: "stat",

name: "Please select the review category:",

width: 152,

height: 23,

char_width: 15,

alignment: "align_fill",

font: "dialog",

},

{

type: "radio",

item_id: "Chk1",

group_id: "rado",

name: "Approved - Submit Final Copies",

},

{

type: "radio",

item_id: "Chk2",

group_id: "rado",

name: "Approved as commented - Resubmit",

},

{

type: "radio",

item_id: "Chk3",

group_id: "rado",

name: "Not Approved - Resubmit",

},

{

type: "radio",

item_id: "Chk4",

group_id: "rado",

name: "Cleared for Manufacture",

},

{

type: "radio",

item_id: "Chk5",

group_id: "rado",

name: "For Information",

},

{ type: "edit_text",

item_id: "Name",

height: 23,

char_width: 20,

char_height: 10,

alignment: "align_center",

name: "Enter Initials",

}

]

},

{

type: "ok_cancel",

},

]

},

]

}

};

arunas36741820
Participating Frequently
July 5, 2016

The above code is working only if my source stamp file is open first before the pdf in which I want to stamp is open. if the source stamp file is not open, the pop up box for input is not opening! it directly applies the seal on PDF without taking the user input

try67
Community Expert
Community Expert
July 5, 2016

Where did you place this code? Are you sure you're using the correct stampName value?