Skip to main content
September 2, 2016
Question

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

  • September 2, 2016
  • 1 reply
  • 518 views

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

This topic has been closed for replies.

1 reply

Inspiring
September 2, 2016

Can you post the code you're currently using?

September 2, 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

September 6, 2016

can I get the help on this?