take the answer from radio button to comment tex
Dear all, hope you are good and safe,
wondering if someone can help me with this,
I would like to have some radio buttons in pop up message (from scripting) and pick the answer to an annot comment (sticky note), I already have the idea in separated code lines but couldn't figure out or find how to link the answer of the button choice to the input of the annot. The idea is to avoid type something when you can even better select the choice. thanks in advance for your suggestions! appreciated!
******Radio button*******
ar FormRouting =
{
result:"cancel",
DoDialog: function(){return app.execDialog(this);},
bChk1:false,
bChk2:false,
bChk3:false,
initialize: function(dialog)
{
var dlgInit =
{
"Chk1": this.bChk1,
"Chk2": this.bChk2,
"Chk3": this.bChk3,
};
dialog.load(dlgInit);
},
commit: function(dialog)
{
var oRslt = dialog.store();
this.bChk1 = oRslt["Chk1"];
this.bChk2 = oRslt["Chk2"];
this.bChk3 = oRslt["Chk3"];
},
description:
{
name: "Form Routing",
elements:
[
{
type: "view",
elements:
[
{
type: "view",
char_height: 10,
elements:
[
{
type: "static_text",
item_id: "stat",
name: "Blue:",
char_width: 15,
alignment: "align_fill",
font: "dialog",
},
{
type: "view",
char_width: 8,
char_height: 8,
align_children: "align_top",
elements:
[
{
type: "view",
char_width: 8,
char_height: 8,
elements:
[
{
type: "check_box",
item_id: "Chk1",
name: "Client File",
},
{
type: "check_box",
item_id: "Chk2",
name: "White",
},
{
type: "check_box",
item_id: "Chk3",
name: "Red",
},
]
},
{
type: "view",
char_width: 8,
char_height: 8,
elements:
[
{
},
]
},
]
},
]
},
{
type: "ok_cancel",
},
]
},
]
}
};
// Example Code
FormRouting.bChk1 = false;
FormRouting.bChk2 = false;
FormRouting.bChk3 = false;
if("ok" == FormRouting.DoDialog())
{
console.println("Chk1:" + FormRouting.bChk1);
console.println("Chk2:" + FormRouting.bChk2);
console.println("Chk3:" + FormRouting.bChk3);
}
*****Annot****
var rNew = app.alert("test to place info from radio button to annot comment",2,2,"***TEST***");
if(rNew == 4) {
// User Pressed Yes, Do submission //
var_Color = app.response("COLOR: instead of the response blank, shoud be the radio button options to select Blue, White or Red.");
var annotColor = this.addAnnot({
page: 0,
type: "Text",
author: identity.loginName,
name: "COLOR",
point: [100, 500],
lock: "false" });
var spansColor = new Array();
spansColor[0] = new Object();
spansColor[0].text = "• COLOR: ";
spansColor[0].textColor = color.blue;
spansColor[0].fontWeight = 700;
spansColor[0].textSize = 12;
spansColor[1] = new Object();
spansColor[1].text = var_Color + "\r";
spansColor[1].textColor = color.black;
spansColor[1].textSize = 12;
annotColor.richContents = spansColor;
}