5 Replies Latest reply on Oct 15, 2014 5:23 AM by try67

    Stamp with Check boxes and Text

    Scott44

      Im attempting to create a stamp with 6 check boxes and two text boxes. When placing the stamp I want the user prompted to check one and enter the date and their name. I pieced together most of this from different codes I found searching, and added some stuff along the way. I am able to get the prompt to come up, however I get the error: 'InvalidSetError: Set not possible, invalid or unknown. Event.value:156:Field Text7:Calculate' Anyone know how to fix this?

       

      Here is the code I am using:

       

       

         var DiaBox =

      {

       

       

      result:"cancel",

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

      bChk1:false,

      bChk2:false,

      bChk3:false,

      bChk4:false,

      bChk5:false,

      stredt1:"",

      stredt2:"",

      initialize: function(dialog)

      {

      var dlgInit =

      {

      "Chk1": this.bChk1,

      "Chk2": this.bChk2,

      "Chk3": this.bChk3,

      "Chk4": this.bChk4,

      "Chk5": this.bChk5,

      "Chk6": this.bChk6,

      "edt7": this.stredt7,

      "edt8": this.stredt8,

      };

      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.bChk6 = oRslt["Chk6"];

      this.edt7 = oRslt["edt7"];

      this.edt8 = oRslt["edt8"];

      },

      description:

      {

      name: "tKJfONHcAO3im7LqqlSJ3B",

      elements:

      [

      {

      type: "view",

      elements:

      [

      {

      type: "view",

      char_height: 10,

      elements:

      [

      {

      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: "Chk1",

      name: "Approved as Submitted",

      },

      {

      type: "check_box",

      item_id: "Chk2",

      name: "Approved as Noted",

      },

      {

      type: "check_box",

      item_id: "Chk3",

      name: "Submit Specified Items",

      },

      {

      type: "check_box",

      item_id: "Chk4",

      name: "Revise and Resubmit",

      },

      {

      type: "check_box",

      item_id: "Chk5",

      name: "Rejected",

      },

      {

      type: "check_box",

      item_id: "Chk6",

      name: "Reviewed",

      },

      {

      type: "static_text",

      item_id: "sta1",

      name: "Date",

      alignment: "align_row",

      },

      {

      type: "edit_text",

      item_id: "edt1",

      char_width: 20,

      char_height: 6,

      alignment: "align_left",

      },

      {

      type: "static_text",

      item_id: "sta2",

      name: "Name:",

      },

      {

      type: "edit_text",

      item_id: "edt1",

      char_width: 20,

      char_height: 6,

      alignment: "align_left",

      }

      ]

      },

      {

      type: "ok_cancel",

      },

      ]

      },

      ]

      }

      };

       

       

      // Example Code

      //DiaBox.bChk1 = false;

      //DiaBox.bChk2 = false;

      //DiaBox.bChk3 = false;

      //DiaBox.bChk4 = false;

      //DiaBox.bChk5 = false;

      //DiaBox.bChk6 = false;

      //DiaBox.stredt7 = "";

      //DiaBox.stredt8 = "";

       

       

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

      {

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

        {

       

       

          this.getField("cbx1").checkThisBox(0, DiaBox.bChk1);

          this.getField("cbx2").checkThisBox(0, DiaBox.bChk2);

          this.getField("cbx3").checkThisBox(0, DiaBox.bChk3);

          this.getField("cbx4").checkThisBox(0, DiaBox.bChk4);

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

        }

      }

       

       

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

        {

          var cMsg = DiaBox.byName;

          event.value = cMsg;

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

        }