rem: var labels = form.getElementsByTagName("label"); 
add: var labels = formWrapper.getElementsByTagName("label"); 
context: function onFormSelect(){  var formTree = document.getElementById("formtree");  if (!formView.rowCount) return;  if (formView.selection.count == 1)  {    var formPreview = document.getElementById("formpreview");    fieldView.clear();    formPreview.treeBoxObject.view = fieldView;    var clickedRow = formView.selection.currentIndex;    // form-node;    var form = formView.data[clickedRow][3];    var ft = null;    if (form.name)      ft = theBundle.getFormattedString("formTitle", [form.name]);    document.getElementById("formname").value = ft || theBundle.getString("formUntitled");    document.getElementById("formenctype").value = form.encoding || theBundle.getString("default");    document.getElementById("formtarget").value = form.target || theBundle.getString("formDefaultTarget");    var formfields = form.elements;    var length = formfields.length;    var i = 0;    var checked = theBundle.getString("formChecked");    var unchecked = theBundle.getString("formUnchecked");        for (i = 0; i < length; i++)    {      var elem = formfields[i], val;      if (elem instanceof nsIButtonElement)        val = getValueText(elem);      else        val = (/^password$/i.test(elem.type)) ? theBundle.getString("formPassword") : elem.value;      fieldView.addRow(["", elem.name, elem.type, val]);    }    var labels = form.getElementsByTagName("label");    var llength = labels.length;    var label;    for (i = 0; i < llength; i++)    {      label = labels[i];      var whatfor = label.hasAttribute("for") ?        theDocument.getElementById(label.getAttribute("for")) :        findFirstControl(label);      if (whatfor && (whatfor.form == form))       {        var labeltext = getValueText(label);        for (var j = 0; j < length; j++)          if (formfields[j] == whatfor) {            var col = formPreview.columns["field-label"];            fieldView.setCellText(j, col, labeltext);          }      }    }  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/1b4c9c32872321490762b0cb9bb09a9955770f65/pageInfo.js/buggy/suite/browser/pageInfo.js