Michael Schuerig wrote:
> Supposedly Prototype extends the HTMLFormElement.prototype so that the
> following code ought to work
>
> $('myform').focusFirstElement()
The function in Prototype.js should provide a hint:
focusFirstElement: function(form) { ... }
Which indicates it requires a form as an argument. Try:
focusFirstElement('myform');
Which works in Firefox but fails in Safari. You might prefer the much
more widely supported:
document.forms['myform'].elements[0].focus();
or, if the form's name is myform you can use the shorter:
document.myform.elements[0].focus();
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---