Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Can you post the code you're currently using?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
can I get the help on this?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now