Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Acrobat Stamp Checkbox Coding Problem
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Acrobat Stamp Checkbox Coding Problem

 Post Reply Post Reply
Author
jleckner View Drop Down
New Member
New Member


Joined: 22 Oct 2013
Points: 2
Post Options Post Options   Quote jleckner Quote  Post ReplyReply Direct Link To This Post Topic: Acrobat Stamp Checkbox Coding Problem
    Posted: 22 Oct 2013 at 7:18pm
Thanks for any help you can provide.

Scope is a dynamic acrobat stamp file.

I have successfully created a dialog prompt and set stamp fields to the text that was input.
I am unsuccessful and having trouble with the checkboxes.

I cannot seem to find the way to proper set the boxes checked on stamp/form.

Field Names are "Chbox1" through 5. I have tried everything google search's come back with. 

I need help setting code to check boxes 1-5 if checked. Similar to how I have text typed in, then set to field. i.e. this.getField("Submittal Number").value = cMsg;

THANKS AGAIN!



var DiaBox =
{
    result:"cancel",
    DoDialog: function(){return app.execDialog(this);},
    bChbx1:"",
    bChbx2:"",
    bChbx3:"",
    bChbx4:"",
    bChbx5:"",
    stredt1:"",
    stredt2:"",
    stredt3:"",
    stredt4:"",

    initialize: function(dialog)
    {
        var dlgInit = 
        {
            "Chbx1": this.bChbx1,
            "Chbx2": this.bChbx2,
            "Chbx3": this.bChbx3,
            "Chbx4": this.bChbx4,
            "Chbx5": this.bChbx5,
            "edt1": this.stredt1,
            "edt2": this.stredt2,
            "edt3": this.stredt3,
            "edt4": this.stredt3,
        };
        
        dialog.load(dlgInit);
    },
    
    commit: function(dialog)
    {
        var oRslt = dialog.store();
        this.bChbx1 = oRslt["Chbx1"];
        this.bChbx2 = oRslt["Chbx2"];
        this.bChbx3 = oRslt["Chbx3"];
        this.bChbx4 = oRslt["Chbx4"];
        this.bChbx5 = oRslt["Chbx5"];
        this.JobNumber = oRslt["edt1"];
        this.SubmittalNumber = oRslt["edt2"];
        this.Date = oRslt["edt3"];
        this.SpecSection = oRslt["edt4"];
    },
    
    description:
    {
        name: "Stamp",
        elements:
        [
        {
            type: "view",
            elements:
            [ //se2
            {
                type: "view",
                char_height: 10,
                elements:
                [ // se1
                {
                    type: "static_text",
                    item_id: "JobNumber",
                    name: "Job Number:",
                    alignment: "align_row",
                },
                {
                    type: "edit_text",
                    item_id: "edt1",
                    char_width: 20,
                    alignment: "align_left",
                    font: "palette",
                },
                {
                    type: "static_text",
                    item_id: "SubmittalNumber",
                    name: "Submittal #:",
                },
                {
                    type: "edit_text",
                    item_id: "edt2",
                    char_width: 20,
                    alignment: "align_left",
                    font: "palette",
                },
                {
                    type: "static_text",
                    item_id: "Date",
                    name: "Date:",
                },
                {
                    type: "edit_text",
                    item_id: "edt3",
                    char_width: 20,
                    alignment: "align_left",
                    font: "palette",
                },
                {
                    type: "static_text",
                    item_id: "SpecSection",
                    name: "Spec Section:",
                },
                {
                    type: "edit_text",
                    item_id: "edt4",
                    char_width: 20,
                    alignment: "align_left",
                    font: "palette",
                },
                {
                    type: "static_text",
                    item_id: "stat",
                    name: "Check only ONE box:",
                    width: 152,
                    height: 23,
                    char_width: 15,
                    alignment: "align_fill",
                    font: "dialog",
                },
                {
                    type: "check_box",
                    item_id: "Chbox1",
                    name: "Reviewed",
                },
                {
                    type: "check_box",
                    item_id: "Chbox2",
                    name: "Make Changes Noted",
                },
                {
                    type: "check_box",
                    item_id: "Chbox3",
                    name: "Revise and Resubmit",
                },    
                {
                    type: "check_box",
                    item_id: "Chbox4",
                    name: "Rejected - Resubmit",
                },
                {
                    type: "check_box",
                    item_id: "Chbox5",
                    name: "Deviation From Contract Requirement",
                },

                ] // ee1
            },
            {
                type: "ok_cancel",
            },
            ] //ee2
        },
        ]
    } // end description:
}; //end var Diabox

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

  if ("ok" == app.execDialog(DiaBox))
  {
    var cMsg = DiaBox.JobNumber;
    event.value = cMsg;
    event.source.source.info.exhibit = cMsg;

    cMsg = DiaBox.SubmittalNumber;
    this.getField("SubmittalNumber").value = cMsg;

    cMsg = DiaBox.Date;
    this.getField("Date").value = cMsg;

    cMsg = DiaBox.SpecSection;
    this.getField("SpecSection").value = cMsg;



  // this.getField("Chbox3").checkThisBox(0,true); 
 //   this.getField("Chbox4").checkThisBox(0,true); 
 //  this.getField("Chbx5").checkThisBox(0,false); 
  }  
}

Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 23 Oct 2013 at 12:10am
Try this:
this.getField("Chbox3").checkThisBox(0,DiaBox.bChbx3); 

- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
jleckner View Drop Down
New Member
New Member


Joined: 22 Oct 2013
Points: 2
Post Options Post Options   Quote jleckner Quote  Post ReplyReply Direct Link To This Post Posted: 23 Oct 2013 at 1:36pm
No go. The command gets ignored, checkbox still appears unchecked on stamp.


Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 23 Oct 2013 at 1:37pm
Can you share the file? If you want, you can email it to me.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.047 seconds.