Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding command button in dialog box and while pressing that command button value gets displayed on text box

Guest
Sep 01, 2016 Sep 01, 2016

Hi,

I wanted to create a calculator simulation using javascript in Adobe acrobat.

First I have added dialog box and i have added text box in that.  Again I have added command button for number 1,2,3 etc.  I wanted to display 1 when I am pressing 1 command button,2 when i am pressing 2 and so on.   But i am not getting the values to text box while pressing command button.

can any one help me on this?

Ariv

TOPICS
Acrobat SDK and JavaScript
484
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 01, 2016 Sep 01, 2016

Can you post the code you're currently using?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2016 Sep 02, 2016

Here is my code.  If I wanted to place command button in three columns same like calculator how can i do that?

Dialogbx=app.trustedFunction( function()

{

app.beginPriv();

var dialog1={

DoDialog: function()

{

return app.execDialog(this);

},

initialize: function(dialog)

{

this.r=false;

var dlgInit={ "not1": this.strnot1

},

commit: function(dialog)

{

var result=dialog.store();

console.println(result["not1"]);

},

b1: function(dialog)

{

result["not1"]=result["b1"];

},

description:{

name: "dlg1",

elements:

[

{

type: "view",

elements:

[

{

type: "cluster",

item_id: "cls1",

name: "Notes",

elements:

[

{

type: "edit_text",

multiline: "true",

item_id: "not1",

width: 300,

height: 20,

},

{

type: "button",

align_children: "align_row",

item_id: "b1",

width:5,

height: 30,

name: "1",

},

{

type: "button",

align_children: "align_row",

item_id: "b2",

width:5,

height: 30,

name: "2",

},

{

type: "button",

align_children: "align_row",

item_id: "b3",

width:5,

height: 30,

name: "3",

},

{

type: "button",

align_children: "align_row",

item_id: "b4",

width:5,

height: 30,

name: "4",

},

]

}

]

},

{

type: "ok",

}

]

}

};

dialog1.strnot1="Welcome";

dialog1.DoDialog();

app.alert("completed");

app.endPriv();

});

app.addToolButton({

cName: "Dialogbx",

cExec: "Dialogbx();"

cTooltext: "Dialogbx"});

Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 06, 2016 Sep 06, 2016
LATEST

can I get the help on this?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines