Hey,
If you look into CSS3 carefully you'll see the selector for your needs
is actually longer than your custom findAll call. It would probably go
something like this (wrapped/indented for this e-mail):
var fields =
yourForm.select('select:not(:disabled),textarea:not(:disabled),
input:not(:disabled)[type!=hidden][type!=button][type!=submit]');
Quite a mouthful. I'm not at all sure it makes for "sweeter syntax"
than a custom filter:
var fields = yourForm.getElements().findAll(function(e) {
return !e.disabled && !'hidden button submit'.include(e.type);
});
As for performance comparisons, I'm also confident the custom filter
will be way faster on one-shot uses or non-XPath contexts.
'HTH
--
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---