rem: if (formElement.defaultValue) 
add: if ("defaultValue" in formElement) 
context: function setFormElementValue(formElement, value) {  //formElement.value = formElement.defaultValue;  //  formElement.checked = formElement.defaultChecked;  var type = formElement.localName;  if (type == "checkbox") {    if (value == undefined) {      if (formElement.defaultChecked)        formElement.checked = formElement.defaultChecked;      else        formElement.checked = false;    } else {      if (formElement.getAttribute("reversed"))        formElement.checked = !value;      else        formElement.checked = value;    }  }  else if (type == "radiogroup" || type =="menulist") {    var selectedItem;    if (value == undefined) {      if (type == "radiogroup")        selectedItem = formElement.firstChild;      else        selectedItem = formElement.firstChild.firstChild;    }    else      selectedItem = formElement.getElementsByAttribute("value", value)[0];    formElement.selectedItem = selectedItem;  }  // handle nsIFileSpec  else if (type == "textbox" &&           formElement.getAttribute("datatype") == "nsIFileSpec") {    if (value) {      var filespec = value.QueryInterface(Components.interfaces.nsIFileSpec);      try {        formElement.value = filespec.nativePath;      } catch (ex) {        dump("Still need to fix uninitialized filespec problem!\n");      }    } else {      if (formElement.defaultValue)        formElement.value = formElement.defaultValue;      else        formElement.value = "";    }  }  else if (type == "textbox" &&           formElement.getAttribute("datatype") == "nsILocalFile") {    if (value) {      var localfile = value.QueryInterface(Components.interfaces.nsILocalFile);      try {        formElement.value = localfile.path;      } catch (ex) {        dump("Still need to fix uninitialized nsIFile problem!\n");      }    } else {      if (formElement.defaultValue)        formElement.value = formElement.defaultValue;      else        formElement.value = "";    }  }  else if (type == "text") {    if (value == null || value == undefined)      formElement.removeAttribute("value");    else      formElement.setAttribute("value",value);  }  // let the form figure out what to do with it  else {    if (value == undefined) {      if (formElement.defaultValue)        formElement.value = formElement.defaultValue;    }    else      formElement.value = value;  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/0cd2634928600ba1fd1aa18c4889432a3fb7b444/AccountManager.js/buggy/mailnews/base/prefs/resources/content/AccountManager.js