10 Replies Latest reply on Dec 17, 2012 3:24 AM by dbibhas

    Can we dynamically create full "description:" part in the acrobat JavaScript dialog?

    dbibhas

      Dear All,

       

      I have a PDF form and on click from where a dialog will open. Please see the sample coding below.

       

      //Source: http://acrobatusers.com/tutorials/print/custom-dialog-boxes-part-5

      // Dialog Definition

      var testDlg = { description: { name: "Test Dialog", elements: [ { type: "view", elements: [ { name: "Enter your name:", type: "static_text", }, { item_id: "usnm", type: "edit_text", char_width: 15 }, { type: "ok_cancel", }, ] }, ] } };

      // Dialog Activation

      app.execDialog(testDlg);

       

      Now, with refer to the above code I want to create the description part dynamically. I mean to say full description part  "{ description: ....... };"  will create dynamically and stores in variable and if that variable's value assign to the "testDlg" , my dialog has to open properly with proper UI.

       

      var  temp = "{ description: { name: "Test Dialog", elements: [ { type: "view", elements: [ { name: "Enter your name:", type: "static_text", }, { item_id: "usnm", type: "edit_text", char_width: 15 }, { type: "ok_cancel", }, ] }, ] } }";

       

      var testDlg = temp;

       

      Now, my question is that my above approach will work ? Please help me. This is Urgent!