I am constructing a dialog in pdf javascript, which contains multiple groups of radio buttons.
What i don’t get is how to set a default selection for any one group.
The example i have attached below is shortened to only one radio button group.
I do believe that using a check box for this task would probably be better it is not my decision to make.
var oDlg = {
result: "cancel",
DoDialog: function() { return app.execDialog(this); },
complete: false,
commit: function(dialog) {
var result = dialog.store();
this.complete = result["completeTrue"];
},
description: {
name: "ADialog",
elements:
[
{
type: "view",
elements:
[
{
type: "view",
align_children: "align_row",
elements:
[
{
name: "Is complete?",
type: "static_text",
char_width: 15,
},
{
item_id: "completeTrue",
group_id: "complete",
type: "radio", char_width: 15,
name: "Yes"
},
{
item_id: "completeFalse",
group_id: "complete",
type: "radio",
char_width: 15,
name: "No" },
]
},
]
},
{ type: "ok_cancel", },
]
}
};
I tried checked and selected in various different ways, and couldn’t get that to work. Googling resulted in me trying this.getField("completed").value = someIndex;
which also did nothing.
The expected result is that instead of the “Yes” radio button being selected when the dialog opens, the “No” button is selected.