3 Replies Latest reply on Jun 11, 2015 2:05 PM by try67

    SyntaxError constantly...opinions welcome....

    JohnnyBQue Level 1

      Keep getting the following error "SyntaxError: missing: after property id" and the line points to the "QTY: ""," any ideas?

       

       

      //<AcroForm>

      //<ACRO_source>CaseNumField:Calculate</ACRO_source>

      //<ACRO_script>

      /*********** belongs to: AcroForm:CaseNumField:Calculate ***********/

      var dialog = {

       

                  Due: "",

                 W/O#: "",

                  QTY: "",

           Issue Date: "",

             Issue To: "",

       

              commit:function (dialog) { // called when OK pressed

                      var results = dialog.store();

                      this.Due = results["tx1"];

                      this.W/O# = results["tx2"];

              this.QTY = results["tx3"];

              this.Issue Date = results["tx4"];

              this.Issue To = results["tx5"];

              },     

       

              description:

              {      

                      name: "Control Stamp Information",    // Dialog box title

                      elements:

                      [      

                              {      

                                      type: "view",

                                      elements:

                                      [      

                                              {      

                                                      name: "Due: ",

                                                      type: "static_text",

                                              },     

                                              {      

                                                      item_id: "tx1",

                                                      type: "edit_text",

                                                      multiline: true,

                                                      width: 300,

                                                      height: 80

                                              }, 

                                              {      

                                                      name: "W/O#: ",

                                                      type: "static_text",

                                              },     

                                              {      

                                                      item_id: "tx2",

                                                      type: "edit_text",

                                                      multiline: true,

                                                      width: 300,

                                                      height: 80

                                              }, 

                                              {      

                                                      name: "QTY: ",

                                                      type: "static_text",

                                              },     

                                              {      

                                                      item_id: "tx3",

                                                      type: "edit_text",

                                                      multiline: true,

                                                      width: 300,

                                                      height: 80

                                              },

                                              {      

                                                      name: "Issue Date: ",

                                                      type: "static_text",

                                              },     

                                              {      

                                                      item_id: "tx4",

                                                      type: "edit_text",

                                                      multiline: true,

                                                      width: 300,

                                                      height: 80

                                              },

                                              {      

                                                      name: "Issue To: ",

                                                      type: "static_text",

                                              },     

                                              {      

                                                      item_id: "tx5",

                                                      type: "edit_text",

                                                      multiline: true,

                                                      width: 300,

                                                      height: 80

                                              }, 

                                              {      

                                                      type: "ok_cancel",

                                                      ok_name: "Ok",

                                                      cancel_name: "Cancel"

                                              },     

                                      ]      

                              },     

                      ]      

              }      

      };

       

       

      if(event.source.forReal && (event.source.stampName == "#rJluzMtNX97N-XLeooaxwD"))

      {

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

        {

          var cMsg = dialog.caseValue;

          event.value = "Case\n" + cMsg;

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

       

          cMsg = "Exhibit\n" + dialog.exhibitValue;

          this.getField("ExhibitNumField").value = cMsg;

        }

      }

        • 1. Re: SyntaxError constantly...opinions welcome....
          try67 MVP & Adobe Community Professional

          The problem is actually with the line before that. Put the object name in

          it in double-quotes, since it contains special characters.

          • 2. Re: SyntaxError constantly...opinions welcome....
            JohnnyBQue Level 1

            your were correct...I actually change the name to eliminate the "special Characters" not good practice...I get my dialog box to open no problem I enter data click okay but the stamp shows that the text field are "undefined". The Text field names are "Due" and "WorkOrder" in the pic below they show up "DueValue" and WOrkOrderValue" then the results as shown "undefined" for both. I put the code at the bottom I remove the section that caused the word "value" to show up at the end of Due and Work Order.

             

             

            //<AcroForm>

            //<ACRO_source>CaseNumField:Calculate</ACRO_source>

            //<ACRO_script>

            /*********** belongs to: AcroForm:CaseNumField:Calculate ***********/

            var dialog = {

                           DueValue: "",

                     WorkOrderValue: "",

                          

             

             

                    commit:function (dialog) { // called when OK pressed

                            var results = dialog.store();

                            this.DueValue = results["tx1"];

                            this.WorkOrderValue = results["tx2"];

                   

                    },     

             

                    description:

                    {      

                            name: "Control Stamp Information",    // Dialog box title

                            elements:

                            [      

                                    {      

                                            type: "view",

                                            elements:

                                            [      

                                                    {      

                                                            name: "Due: ",

                                                            type: "static_text",

                                                    },     

                                                    {      

                                                            item_id: "tx1",

                                                            type: "edit_text",

                                                            multiline: true,

                                                            width: 200,

                                                            height: 40

                                                    }, 

                                                    {      

                                                            name: "Work Order #: ",

                                                            type: "static_text",

                                                    },     

                                                    {      

                                                            item_id: "tx2",

                                                            type: "edit_text",

                                                            multiline: true,

                                                            width: 200,

                                                            height: 40

                                                    }, 

                                                    {      

                                                            type: "ok_cancel",

                                                            ok_name: "Ok",

                                                            cancel_name: "Cancel"

                                                    },     

                                            ]      

                                    },     

                            ]      

                    }      

            };

             

             

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

            {

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

              {

                var cMsg = dialog.DueValue;

                event.value = "Due\n" + cMsg;

                event.source.source.info.DueValue = cMsg;

             

                cMsg = "Work Order\n" + dialog.WorkOrderValue;

                this.getField("WorkOrder").value = cMsg;

              }

            }

            • 3. Re: SyntaxError constantly...opinions welcome....
              try67 MVP & Adobe Community Professional

              The item_id property must be 4 characters exactly, not more and not less.