TommyIndigo
Programmer
I have a select field I need to use to toggle visibility of other form fields. I am writing an onchange function to do this.
My problem is that the label for the field still appears...so I would like to hide the entire row. However, I cannot place an ID in the <TR> tag, as the form is generated BEFORE it gets to the code I am writing (I am just writing the validation and toggling script and have no control over the form html).
Can I possibly hide a table row WITH ONLY THE KNOWLEDGE OF A SINGLE FORM ELEMENT NAME?
Any advice would be most appreciated!!
If it is helpful, here is the relevant code I have so far.
My problem is that the label for the field still appears...so I would like to hide the entire row. However, I cannot place an ID in the <TR> tag, as the form is generated BEFORE it gets to the code I am writing (I am just writing the validation and toggling script and have no control over the form html).
Can I possibly hide a table row WITH ONLY THE KNOWLEDGE OF A SINGLE FORM ELEMENT NAME?
Any advice would be most appreciated!!
If it is helpful, here is the relevant code I have so far.
Code:
alert('This is NOT a formal decision. Unused fields should be hidden.');
//Identify the list of fields associated with formal decisions
var FieldList = new Array(
'DecisionTeam',
'ProblemStatement',
'EvaluationCriteria'
);
//Loop through DAR fields and hide
var FieldListLength = FieldList.length;
var counter=0;
for (counter=0; counter<FieldListLength; counter++)
{
var CurrentFieldName = FieldList[counter];
var FormFieldExaminedString = 'window.document.forms[0].'+CurrentFieldName;
var EvaluatedField = eval(FormFieldExaminedString);
EvaluatedField.style.display = 'none';
}