prototype.js,  Version: '', Line 3462

  focusFirstElement: function(form) {
    form = $(form);
    return form;

this code is unsafe. findFirstElement() function returns empty value,
if form has no elements. look at this:

var elements = $(form).getElements().findAll(function(element) {
      return 'hidden' != element.type && !element.disabled;

so, our solution is to rewrite focusFirstElement like this:

  focusFirstElement: function(form) {
    form = $(form);
    var element = Form.findFirstElement(form);
    return form;

What do you think?

Alexander Chernin, Naumen comp.

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to