[jQuery] JQuery and Prototypes $F-Function
Hi JQuery list,
I just got to know JQuery about a week ago and gave it a try in a project I
am currently working on. Its nothing about any fancy Web 2.0 things, only
simple client-side validation and enhanced UI. What I am missing most with
JQuery is support for manipulating forms. There seems to be no shorthand to
retrieve a form element by its name. Manipulations like disabled, checked,
selected etc. are not supported either.
I am far from being an javascript expert: Maybe there is simply no way to
make the code easier with JQuery...
But a feature I saw in Prototype might prove very useful:
http://particletree.com/features/quick-guide-to-prototype/
Here the $F-function is mentioned, which retrieves a value from a given
input element, no matter if its a textarea, a normal text-input, a select or
a checkbox. I think thats quite handy.
In the above guide it says:
"The ability to get a value regardless of the control makes processing forms
incredibly easy in most circumstances. There are only two drawbacks I could
find with this function: 1) there is no easy way of accessing the selected
value of a radio group (only the individual value of a single radio element)
and 2) it is not possible to pass in multiple ID's, like you can with the
$() function."
I think the second point is nothing to worry about. If the function would
return an array of value in case of multiple IDs, the processing itself
won't be much easier.
But maybe there is a solution for the first point, as there can be always
only value selected in a radio group.
Even if JQuery does not provide any extra functions for form manipulation:
It would be very nice to see some examples in the documentation!
Best regards
Jörn
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/