Puoi mettere un evento onfocus sugli elementi dentro il form:
Per ricavare l'elemento col focus ora ti basta richiamare la variabile globale isFocuscodice:window.onload = function() { var f = document.getElementById("formID"), elems = f.getElementsByTagName("*"), fn = function() { window.isFocus = this; } for(var i = 0, = elems.length; i!=l; i++) elems[i].onfocus = fn; }![]()
Attento che non ho provato...