10 Replies Latest reply on Jul 11, 2017 9:32 AM by ChristianBahnsen

    acrobat xi -- return the value of the radio button selected in a custom dialog (TypeError: this.getElementById is not a function)

    ChristianBahnsen

      I've built a custom dialog that's rendering fine.  I emulated some code I found here in the forum, but I'm getting the following error:

      TypeError: this.getElementById is not a function

       

      Presumably I need to replace the "this.getElementById" with some other mechanism to return the value of the radio button selected.

       

      Here's the code as it currently stands:

       

      var oDlg =

      {

         description:

         {

            name: "Save document to which folder?",

            elements:

            [

               {

                  type: "cluster",

                  name: "Choose a folder",

                  elements:

                  [

                   //{

                   // type: "static_text",

                   // name: "Save document to which folder?: "

                   //},

                   {

                    type: "radio",

                    item_id: "rd01",

                    group_id: "rado",

                    name: "completed folder",

                    value: "complete",

                   },

                   {

                    type: "radio",

                    item_id: "rd02",

                    group_id: "rado",

                    name: "need guidance",

                    value: "needGuidance",

                   },

                   {

                    type: "radio",

                    item_id: "rd03",

                    group_id: "rado",

                    name: "no action needed",

                    value: "noActionNeeded",

                   },   

                   {

                        type: "ok_cancel",

                     },

                 ]        

               },

            ]

         }

      };

       

      // Dialog Activation

      app.execDialog(oDlg)

      {

      if (this.getElementById('rd01').checked) {

        destinationFolder = this.getElementById('rd01').value;

        }

      else if (this.getElementById('rd02').checked) {

        destinationFolder = this.getElementById('rd02').value; 

        }

      else if (this.getElementById('rd03').checked) {

        destinationFolder = this.getElementById('rd03').value;

        }

      };

      app.alert(destinationFolder,4);

       

       

       

       

      Thanks

       

      Christian Bahnsen