Spawned page scripting only partially working...
After combing through the forums and garnering some valuable pointers and advice from Nesa, scripting on a spawned template page is now working where it auto-populates other read-only fields. Unfortunately, it refuses to work when combined with show/hide fields.
The script, sans show/hide is identical to what I've implemented in all the required fields and works as it should -- it even works for the "targetField.value" in the example below. It's refusing to show/hide the fields listed on the spawned page while working as needed on the actual template (non-spawned) page.
The JS Debugger returns the following: SyntaxError: syntax error 1:Console:Exec undefined and irrespective of research, I've been unable to figure out what this specifically means and/or how to implement fixing it. Hopefully, the subject matter experts here will get a chuckle and be able to show me where I've screwed something up.
Here is the script and my sincerest thanks in advance for any assistance or advice.
//---BEGIN Cut & Paste---
var cPreFix = "";
var aFieldName = event.target.name.split(".");
if(aFieldName.length > 2)
{
cPreFix = aFieldName[0] + "." + aFieldName[1] + ".";
}
var sourceField = this.getField(cPreFix+"Finding.USCG");
var targetField = this.getField("DISPLAY.USCG.Finding");
if (event.target.isBoxChecked(0)) {
targetField.value = "USCG";
this.getField(cPreFix+"Text.CG-835.Finding").display = display.visible;
this.getField(cPreFix+"Text.CG-835.Yes").display = display.visible;
this.getField(cPreFix+"Text.CG-835.No").display = display.visible;
this.getField(cPreFix+"CG-835.Finding").display = display.visible;
} else {
targetField.value = "";
this.getField(cPreFix+"Text.CG-835.Finding").display = display.hidden;
this.getField(cPreFix+"Text.CG-835.Yes").display = display.hidden;
this.getField(cPreFix+"Text.CG-835.No").display = display.hidden;
this.getField(cPreFix+"CG-835.Finding").display = display.hidden;
}
//---END Cut & Paste---
