The parameter for the "getField" method is the name of the field for which you want the JavaScript field object. The field name is just a string of characters. This string can be a quoted string, a variable with the a value of the string name, a result of some JavaScript code that results in a string value, or a combination of these.
The first snipet of code uses the "event.target.name" property to obtain the name of the field which should be from a form field that was renamed during the spawning code. So the variable "cPreFix" has the prefix items added by the spawning rename. One can the concatenate this variable to the quoted field name to create the field names on the spawned page.
var cPreFix = "";
// get prefix elements for spawned pages;
var aFieldName = event.target.name.split(".");
if(aFieldName.length > 2)
{
// first 2 elements of name array makeup the prefix for fields on a spawned page;
cPreFix = aFieldName[0] + "." + aFieldName[1] + ".";
}
if(this.getField(cPreFix + "Wave Type").value=="THROUGH TRANSMISSION")
{this.getField(cPreFix + "MHz-1").display=display.visible;
this.getField(cPreFix + "MHz-2").display=display.visible;
this.getField(cPreFix + "SN-1").display=display.visible;
this.getField(cPreFix + "SN-2").display=display.visible;
this.getField(cPreFix + "UT-2").display=display.hidden;
this.getField(cPreFix + "SN-4").display=display.hidden;
this.getField(cPreFix + "Blank-1").display=display.hidden;
this.getField(cPreFix + cPreFix + "Blank-2").display=display.visible;
this.getField(cPreFix + "Blank-3").display=display.visible;
this.getField(cPreFix + "Blank-4").display=display.visible;}