Answered
When I call this function (below) using "this.HideSPFields()" nothing happens. I do not get an error message, it just doesn't hide the fields in this Array as I intended. I would be grateful for a helping hand.
function HideSPFields()
{
var fields = new Array
fields[0] = "txtS.Type1-4"
fields[1] = "txtSP"
fields[2] = "cbo.SP"
fields[3] = "rdo.SP"
fields[4] = "btn.Export.SellerIndividuals"
fields[5] = "btn.Copy.SellerIndividualsToBuyerIndividuals"
fields.hidden = true
}
Your declaration of the array variable has an obvious syntax error.
You do not hide a field name(s), you hide the field object.
function HideSPFields() {
// define array of field names
var fields = new Array("txtS.Type1-4", "txtSP",
"cbo.SP", "rdo.SP", "btn.Export.SellerIndividuals",
"btn.Copy.SellerIndividualsToBuyerIndividuals");
// loop through field names
for(i = 0; i < fields.length; i++) {
// hide the field object for the named field
this.getField(fields[i]).hidden = true;
} // end for loop
return;
} // end HideSPFields
HideSPFields();
I would pass the field names to hide to the funciton, so the function is not specific to a field or group of fields.
George Kaiser