Is it possible to have focus events bubble in protoype?
I am trying to prevent having to assign an observer on every input element.
<script language="javascript" type="text/javascript">
document.observe('dom:loaded', function() {
// Doesn't work
$('editForm').observe('focus', function(evnt){
console.log('FOCUS!');
});
// Works
$('editForm').select('INPUT').each(function(elem) {
elem.observe('focus', function(evnt){
console.log('FOCUS!');
});
});
});
</script>
<form method="post" name="editForm" id="editForm" action="">
<input type="text" name="foobar" />
</form>