an application, you probably include a header from each page, so
the way to use this function is to put it in your header (or better
yet, source or include it from your header), and call it onLoad.
That way, it will automatically work on any page in the application
with a form on it. If a page doesn’t have any forms, or you have
a form with no text or textarea inputs, the function does nothing.
for (var i = 0; i < document.forms.length; ++i)
var f = document.forms[i];
for (var j = 0; j < f.elements.length; ++j)
if (f.elements[j].type == 'text' ||
f.elements[j].type == 'textarea')