> I'm just going to reply to myself ... I'm a little confused by the
> proposal of an .attrs() method and it seems unnecessary and using
> selectors is more than I want to remember or type. Getting ride of
> .val() is fine by me but there *needs* to be a method to serialize a
> single form element. Could you possibly include this in the form
> plugin Mike? Just grabbing the value attribute of form elements will
> not always work on single selects and other form elements. These all
> need to be normalized and made *easy*.

I think it would be possible to split form's formToArray function: Extract a 
formValue method(or whatever name you like) that is then used by formToArray 
but also available for other code, say... validation stuff.

The idea about attrs would give us something like this:
$("select option:selected").attrs("value") - return an array with the value 
attribute of each element

The same as:
var values = [];
$("select option:selected").each(function() {
  values[values.length] = $(this).attr("value");
});

But this could be used with every attribute, not just form elements and values. 
I'm not sure if there is another usecase...

--
Jörn Zaefferer

http://bassistance.de

> 
> --
> Brandon Aaron
> 
> On 11/14/06, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> > I often times just need to know the value of one form element and
> > sometimes that could be a group of radio buttons, a select, a multiple
> > select or just a regular input. The current $.val() method is limited
> > only to inputs. I was curious if anyone else needed this funtionality
> > and if it should be in a plugin or in the core?
> >
> > --
> > Brandon Aaron
> >
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to