Radio Button not being assigned a value
Not sure what I am doing wrong but the form is not showing the radio button value default of "No" and even if user clicks on "Yes" or "No," nothing happens (see below):

The way it is supposed to work is that if the user clicks "Yes," the DocNumber will be included in the 1) Filename Preview and 2) Saved Filename. Here are excerpts of the code (I tried to paste the relevant code, see red text for specific concern):
//Set Filename Preview <---This is #1 above
function DoSetFileName(dialog, oDlg)
{
var oRslt = dialog.store();
var strFileName = "";
// Add Document Num
if(oRslt["BegNum"]) <----Not working when user selects radio button with yes and I don't know why
{
strFileName += oRslt["DNum"];
}
strFileName += oDlg.strFileName.replace(/\.pdf/,""); //This is the original file name with the .pdf removed
strFileName += ".pdf"; //Add pdf back to filename
dialog.load({"SvFl":strFileName}); //load filename in preview window
}
//</CodeAbove>
global.DocNumAction =
{
strDocNumInName:"NoNum", <---default value set but not defaulting to "No"
.
.
.
}
var dlgInit =
{
"MrgH": this.nMarginX,
"MrgV": this.nMarginY,
"Bkgd": listBkgd,
"DNum": this.strInitDocNum, //Added so space after doc # (7/7/17SCS)
"SPst": this.bSaveWPostFx,
"Exmp": this.strExmp,
"LPfx": this.strLabelPrefix,
"DocN": this.bIncludeDocNum,
"PgNm": this.bIncludePageNum,
"PPfx": this.strPageNumPrefix,
"PPsf": this.bPageNumPostfix,
"tFPg": this.strStrtPg,
"tTPg": this.strEndPg,
"SvPr": this.strSavePrefix,
"SvPs": this.strSavePostfix,
"SvFl": this.strSvFl,
};
dlgInit[this.strHorzPos] = true;
dlgInit[this.strVertPos] = true;
dlgInit[this.strBoxStateSel] = true;
dlgInit[this.strPgRangeSel] = true;
dlgInit[this.strTotalPgNumInName] = true;
dlgInit[this.strDocNumInName] = true;
dialog.load(dlgInit);
dialog.enable(
{
"tTPg": false,
"tFPg": false,
"PPfx": false,
"DNum": false,
}
);
.
.
.
var exInit = {"ExPg":this.strPgRangeSel =="rFro", "DNum":this.bIncludeDocNum, "PPfx":this.bIncludePageNum,
"PPsf":this.bIncludePageNum, "MrgH":this.strHorzPos!="PosC",
"SvPs":this.bSaveWPostFx ,"SvDn":this.bSaveWPostFx,"NumGrp":this.bSaveWPostFx,
"tFPg":this.strPgRangeSel =="rFro", "tTPg":this.strPgRangeSel == "rFro", "rCur":!this.bHidden};
dialog.enable(exInit);
this.SetDocNumber(dialog, this);
},
.
.
.
commit: function(dialog)
{
var oRslt = dialog.store();
this.strHorzPos = this.GetRadioSel(oRslt,["PosL","PosC","PosR"]);
this.nMarginX = oRslt["MrgH"];
this.strVertPos = this.GetRadioSel(oRslt,["PosT","PosB"]);
this.nMarginY = oRslt["MrgV"];
var path = new Array();
this.strLTyp = (this.GetListSel(oRslt["LTyp"],path))?path.reverse():"";
var path = new Array();
this.strBackgroundCol = (this.GetListSel(oRslt["Bkgd"],path))?path.reverse():"";
this.strExmp = oRslt["Exmp"];
this.strLabelPrefix = oRslt["LPfx"];
this.bIncludeDocNum = oRslt["DocN"];
this.strInitDocNum = oRslt["DNum"];
this.bIncludePageNum = oRslt["PgNm"];
this.strPageNumPrefix = oRslt["PPfx"];
this.bPageNumPostfix = oRslt["PPsf"];
this.strBoxStateSel = "Lckd"
this.strPgRangeSel = this.GetRadioSel(oRslt,["rAll","rCur","rFro"]);
this.strStrtPg = oRslt["tFPg"];
this.strEndPg = oRslt["tTPg"];
this.bSaveWPostFx = oRslt["SPst"];
this.strSavePrefix = oRslt["SvPr"];
this.strTotalPgNumInName = this.GetRadioSel(oRslt,["None","DnPr"]);
this.strDocNumInName = this.GetRadioSel(oRslt,["NoNum","BegNum"]);
this.strSavePostfix = oRslt["SvPs"];
this.strSvFl = oRslt["SvFl"];
},
"Abrt": function(dialog)
{
dialog.end("Abrt");
},
"Skip": function(dialog)
{
dialog.end("Skip");
},
"SvPs": function(dialog)
{
this.SetFileName(dialog,this);
},
"DnPr": function(dialog)
{
this.SetFileName(dialog,this);
},
"None": function(dialog)
{
this.SetFileName(dialog,this);
},
"NoNum": function(dialog)
{
this.SetFileName(dialog,this);
},
"BegNum": function(dialog)
{
this.SetFileName(dialog,this);
},
"SvPr": function(dialog)
{
this.SetFileName(dialog,this);
},
"SPst": function(dialog)
{
dialog.load({"SPst": true }); //added so checkbox for Save File is disabled (SCS)
dialog.enable({"SPst": false }); //added so checkbox for Save File is disabled (SCS)
var bOn = dialog.store()["SPst"];
dialog.enable({"SvPs":bOn,"SvDn":bOn,"NumGrp":bOn});
this.SetFileName(dialog,this);
},
.
.
.
{
type: "cluster",
item_id: "cls1",
name: "FILENAME OPTIONS",
font: "palette",
bold: true,
alignment: "align_fill",
elements:
[
{
type: "view",
align_children: "align_top",
elements:
[
{
type: "static_text",
item_id: "sta9",
name: "Enter Filename(or use default):",
},
{
type: "edit_text",
item_id: "SvPr",
variable_Name: "strSavePrefix",
width: 100,
height: 23,
char_width: 8,
alignment: "align_fill",
},
{
type: "static_text",
item_id: "sta101",
name: "Add Doc Number?:",
},
{
type: "radio",
item_id: "NoNum",
group_id: "NumGrp",
name: "No",
variable_Name: "strDocNumInName",
},
{
type: "radio",
item_id: "BegNum",
group_id: "NumGrp",
name: "Yes",
},
}
.
.
.
// Save File <----This is #2 above
if(global.DocNumAction.bSaveWPostFx) //if save checked
{
var cSavePath = oOrigDoc.path.replace(/\/[^\/]+$/,"/");
//Add Filename
cSavePath += global.DocNumAction.strSavePrefix;
cSavePath += oOrigDoc.documentFileName.replace(/\.pdf/,""); //remove .pdf from the filename
//Add document number
if(global.DocNumAction.strDocNumInName == "BegNum") <----Not working when user selects radiobutton with yes and I don't know why
{
cSavePath += global.DocNumAction.nCurrentDocNum;
}
cSavePath += ".pdf"; //Add .pdf back to filename
oTrgDoc.saveAs(cSavePath);
}
Note: Using Adobe Acrobat X Pro
