I have this small code. I am using the Prototype framework but I am unable to bind elements to the callback function. That's why I have to write the function like this.
How may I improve this code?
Event.observe('firstname', 'keyup', function () {
var form = $('customerform'),
firstname_0 = form["firstname_0"];
firstname.value = this.value;
});
Event.observe('KundeNachname', 'keyup', function () {
var form = $('customerform'),
lastname_0 = form["lastname_0"];
lastname_0.value = this.value;
});