$A(document.getElementsByClassName('text', $('main-form'))).each(function(poElement){
Event.observe(poElement, 'change', function(e){
// this event only fires while tabbing after changing content
Element.addClassName(poElement, 'changed');
}, false);
Event.observe(poElement, 'keypress', function(e){
var cKeyCode = e.keyCode || e.which;
if (cKeyCode == Event.KEY_RETURN){
// but now will fire also while pressing return key
Event.observers.findAll(function(poEventObserver){
return poEventObserver[0] == poElement && poEventObserver[1] == "change";
})[0][2]();
}
}, false);
});