Question Details

avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

dynamic stamp with checkbox

I am trying to make a submittal stamp with a checkbox dialog. I have cobbled it together from several sources. It works almost... With each time that it is used the checkboxes are duplicated on each other in the source stamp. I do not see in my code where the repeat loop is occuring. Any help would be appreciated.

Code is part of the calculate script on a hidden text field:

event.value = event.source.stampName;

console.println("Stamp Name: " + event.source.stampName);




var FormRouting =
{

result:"cancel",
DoDialog: function(){return app.execDialog(this);},
bChk2:false,
bChk3:false,
bChk4:false,
bChk5:false,
bChk6:false,
initialize: function(dialog)
{
var dlgInit =
{
"Chk2": this.bChk2,
"Chk3": this.bChk3,
"Chk4": this.bChk4,
"Chk5": this.bChk5,
"Chk6": this.bChk6,
};
dialog.load(dlgInit);
},
commit: function(dialog)
{
var oRslt = dialog.store();
this.bChk2 = oRslt["Chk2"];
this.bChk3 = oRslt["Chk3"];
this.bChk4 = oRslt["Chk4"];
this.bChk5 = oRslt["Chk5"];
this.bChk6 = oRslt["Chk6"];
},
description:
{
name: "Approval",
elements:
[
{
type: "view",
elements:
[
{
type: "view",
char_height: 10,
elements:
[
{
type: "static_text",
item_id: "stat",
name: "Approval",
char_width: 15,
alignment: "align_fill",
font: "dialog",
},
{
type: "view",
char_width: 8,
char_height: 8,
align_children: "align_top",
elements:
[
{
type: "view",
char_width: 8,
char_height: 8,
elements:
[
{
type: "check_box",
item_id: "Chk2",
name: "No Exceptions Taken",
},
{
type: "check_box",
item_id: "Chk3",
name: "Make Corrections Noted",
},
{
type: "check_box",
item_id: "Chk4",
name: "Amend and Re-Submit",
},
{
type: "check_box",
item_id: "Chk5",
name: "Rejected",
},
{
type: "check_box",
item_id: "Chk6",
name: "Not Reviewed",
},
]
},

]
},
]
},
{
type: "ok_cancel",
},
]
},
]
}
};

// Example Code








if(event.source.forReal && (event.source.stampName == "#HdpnOnoyy70ajq5FL4-RYC"))
{
if("ok" == FormRouting.DoDialog())
{

var namef = "net";
var typef = "checkbox";
var pagef = 1;
var f = this.addField(namef, typef, pagef, [18, 104, 26, 96]);

var f = this.getField("net");
f.strokeColor = color.red;
f.borderStyle = border.s;

var namej = "ar";
var typej = "checkbox";
var pagej = 1;
var j = this.addField(namej, typej, pagej, [18, 95, 26, 87]);

var j = this.getField("ar");
j.strokeColor = color.red;
j.borderStyle = border.s;

var namek = "mcn";
var typek = "checkbox";
var pagek = 1;
var k = this.addField(namek, typek, pagek, [18, 86, 26, 78]);

var k = this.getField("mcn");
k.strokeColor = color.red;
k.borderStyle = border.s;

var namem = "rej";
var typem = "checkbox";
var pagem = 1;
var m = this.addField(namem, typem, pagem, [18, 77, 26, 69]);

var m = this.getField("rej");
m.strokeColor = color.red;
m.borderStyle = border.s;

var namep = "nr";
var typep = "checkbox";
var pagep = 1;
var p = this.addField(namep, typep, pagep, [18, 68, 26, 60]);

var p = this.getField("nr");
p.strokeColor = color.red;
p.borderStyle = border.s;

if(FormRouting.bChk2){f.checkThisBox(0,true);}
if(FormRouting.bChk3){j.checkThisBox(0,true);}
if(FormRouting.bChk4){k.checkThisBox(0,true);}
if(FormRouting.bChk5){m.checkThisBox(0,true);}
if(FormRouting.bChk6){p.checkThisBox(0,true);}
}
}


Tom Buck 688 days ago


2 Answers

avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

There is no reason to "Add" fields to the stamp. Put the check boxes you want onto the stamp to begin with, and then use the code to set the stamp value. Otherwise the script looks great.

The problem is that Acrobat is saving the stamp file after your code adds the check boxes, So you are constantly adding new checkboxes.

Thom Parker
The source for PDF Scripting Info pdfscripting.com

The Acrobat JavaScript Reference, Use it Early and Often

The most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)

Having trouble, Why Doesn't my Script Work


Thom Parker answered 688 days ago  |   Comments (9)  |  New Comment

avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

Thom. Thanks for looking. My problem is that having cobbled this together, I don't really understand what part of the code is "adding" the check boxes. What part should I delete?

Tom Buck Commented 688 days ago  |   Report


avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

Delete all code related to the addField() functions. Basically all the inside the "if" except for the part that sets the checkbox value

Thom Parker Commented 688 days ago  |   Report


avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

Thom, Thanks for the pointer. I commented out the lines below and it works great. One small issue is the tab order of several other fields that I have added to the stamp. Even though I set them to manual and stack them appropriately, they pop up incorrectly in the dialog boxes. Where might I look for the cause of this issue?

event.value = event.source.stampName;

console.println("Stamp Name: " + event.source.stampName);




var FormRouting =
{

result:"cancel",
DoDialog: function(){return app.execDialog(this);},
bChk2:false,
bChk3:false,
bChk4:false,
bChk5:false,
bChk6:false,
initialize: function(dialog)
{
var dlgInit =
{
"Chk2": this.bChk2,
"Chk3": this.bChk3,
"Chk4": this.bChk4,
"Chk5": this.bChk5,
"Chk6": this.bChk6,
};
dialog.load(dlgInit);
},
commit: function(dialog)
{
var oRslt = dialog.store();
this.bChk2 = oRslt["Chk2"];
this.bChk3 = oRslt["Chk3"];
this.bChk4 = oRslt["Chk4"];
this.bChk5 = oRslt["Chk5"];
this.bChk6 = oRslt["Chk6"];
},
description:
{
name: "B Five Approval",
elements:
[
{
type: "view",
elements:
[
{
type: "view",
char_height: 10,
elements:
[
{
type: "static_text",
item_id: "stat",
name: "B Five Approval",
char_width: 15,
alignment: "align_fill",
font: "dialog",
},
{
type: "view",
char_width: 8,
char_height: 8,
align_children: "align_top",
elements:
[
{
type: "view",
char_width: 8,
char_height: 8,
elements:
[
{
type: "check_box",
item_id: "Chk2",
name: "No Exceptions Taken",
},
{
type: "check_box",
item_id: "Chk3",
name: "Make Corrections Noted",
},
{
type: "check_box",
item_id: "Chk4",
name: "Amend and Re-Submit",
},
{
type: "check_box",
item_id: "Chk5",
name: "Rejected",
},
{
type: "check_box",
item_id: "Chk6",
name: "Not Reviewed",
},
]
},

]
},
]
},
{
type: "ok_cancel",
},
]
},
]
}
};

// Example Code








if(event.source.forReal && (event.source.stampName == "#WvA1vbVhqyHy33f9YFy9LB"))
{
if("ok" == FormRouting.DoDialog())
{

var namef = "Chk2";
var typef = "checkbox";
var pagef = 1;
//var f = this.addField(namef, typef, pagef, [18, 104, 26, 96]);

var f = this.getField("Chk2");
f.strokeColor = color.red;
f.borderStyle = border.s;

var namej = "Chk3";
var typej = "checkbox";
var pagej = 1;
//var j = this.addField(namej, typej, pagej, [18, 95, 26, 87]);

var j = this.getField("Chk3");
j.strokeColor = color.red;
j.borderStyle = border.s;

var namek = "Chk4";
var typek = "checkbox";
var pagek = 1;
//var k = this.addField(namek, typek, pagek, [18, 86, 26, 78]);

var k = this.getField("Chk4");
k.strokeColor = color.red;
k.borderStyle = border.s;

var namem = "Chk5";
var typem = "checkbox";
var pagem = 1;
//var m = this.addField(namem, typem, pagem, [18, 77, 26, 69]);

var m = this.getField("Chk5");
m.strokeColor = color.red;
m.borderStyle = border.s;

var namep = "Chk6";
var typep = "checkbox";
var pagep = 1;
//var p = this.addField(namep, typep, pagep, [18, 68, 26, 60]);

var p = this.getField("Chk6");
p.strokeColor = color.red;
p.borderStyle = border.s;

if(FormRouting.bChk2){f.checkThisBox(0,true);}
if(FormRouting.bChk3){j.checkThisBox(0,true);}
if(FormRouting.bChk4){k.checkThisBox(0,true);}
if(FormRouting.bChk5){m.checkThisBox(0,true);}
if(FormRouting.bChk6){p.checkThisBox(0,true);}
}
}

Tom Buck Commented 686 days ago  |   Report


avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

Ok, so you're talking about the tab order of items on the custom dialog, not the fields on the stamp. The tab order of the stamp fields is irrelevant because no one will ever interact with them. The tab order of the dialog fields is set in the code that creates the dialog, i.e, the dialog object.

Look up Tabbing in the AcroDialogs help.

Thom Parker Commented 685 days ago  |   Report


avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

Sorry, the tab order within the custom dialog is fine. I have several other fields on the custom stamp and the tab order won't follow the tab order that I have set. The custom dialog is simply one of the group of fields. Elsewhere I have read that the tabbing is buggy in general. I was hoping that there is a known fix

Tom Buck Commented 685 days ago  |   Report


avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

Tabbing in Acrobat is not buggy, as much as it is wrong. Acrobat thinks it knows how fields should be tabbed better than you, and so it automatically resets the tabbing each time to try to change it.

So these fields with the bad tabbing. Do they appear on the stamp? How is the user interacting with them?

Thom Parker Commented 685 days ago  |   Report


avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

There are 5 fields in addition to the custom dialog box: datein, dateout, submittalNo, specSect, reviewer. Pretty simple. After finishing with all of the fields, I set them to manual tab order and ordered them in the right pane (Acrobat X). When I insert the stamp the order is different, but it is not even top down. So I can't figure out where the order is coming from.

Tom Buck Commented 685 days ago  |   Report


avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

I'm not sure I understand you. You have a dynamic stamp with 6 checkboxes and 5 text fields. The custom dialog box displays when the stamp is applied to a PDF. The dialog collects data from the user for the check boxes.

Let me know if I'm correct so far.

Now, how are the other 5 fields filled with data? And how do you know the tabbing order has changed when the stamp is placed on a PDF?

Thom Parker Commented 685 days ago  |   Report


avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

You are correct. The dialog box is simply one of a sequence of user prompts. The others are merely text fields that pop up one after another till all are filled. Then the stamp drops into place. I could post the stamp itself to make it clearer. Is there a way to do attachments on this forum?

Tom Buck Commented 685 days ago  |   Report


avatar

  |   Report
Was this answer helpful?  
0
0

avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

Ok, I think I know what the issue is. I'm assuming that by "text Fields popup" that you mean an app.response() popup? And that by tab order you mean the order in which these response boxes popup?
The order of stamp script execution is the calculation order of the scripts in the stamp file, not the tab order. I hope this helps.

Also, it is possible (actually preferable) to use the custom popup to collect the text inputs, instead of using individual response boxes. You can easily add these inputs with AcroDialogs. I'm assuming you already have this tool since it was used to create the dialog you are using now.



Thom Parker answered 685 days ago  |   Comments (0)  |  New Comment

avatar

  |   Report
Was this answer helpful?  
0
0


Send, sign, track
and file documents
in 3 steps.

Try EchoSign for free


Other Questions Needing Answers


HIPAA compliant?

Asked by Terra Caudill · 1 answer