Re: [jQuery] $.val() limited in functionality?

2006-11-16 Thread Mike Alsup
The value for the Hidden field is hiddenValue and not secret. :) Fixed. :-) In the case of the checkboxes, if you check two boxes and use [EMAIL PROTECTED] fieldValue will only show the first value. That would need to go into the array case like the select-multiple. But, if there is only

Re: [jQuery] $.val() limited in functionality?

2006-11-16 Thread Mike Alsup
I've taken a stab at adding fieldValue and fieldSerialize to the form plugin. Please let me know if this impl makes sense. I also refactored ajaxSubmit so that it passes its options arg on to the $.ajax method (so any $.ajax options flow right through). I've got a test page up here:

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
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

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Klaus Hartl
For radios/checkboxes: Can we rely on searching for siblings? Or do we need to search for the name inside the current form? No, we can't! There may be labels around it or divs/lis whatever in between... It should search for the name in the document! -- Klaus

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
For radios/checkboxes: Can we rely on searching for siblings? Or do we need to search for the name inside the current form? No, we can't! There may be labels around it or divs/lis whatever in between... It should search for the name in the document! But the document may contain other

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Klaus Hartl
Jörn Zaefferer schrieb: For radios/checkboxes: Can we rely on searching for siblings? Or do we need to search for the name inside the current form? No, we can't! There may be labels around it or divs/lis whatever in between... It should search for the name in the document! But the

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Dave Methvin
Currently val() is only a shortcut, but doesn't encapsulate anything useful. It would be nice to have it handling some more stuff. I wouldn't like to have it in an external plugin, that makes it difficult to access or find it when you actually need that functionality. Right now val() is a

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
Hi Dave! Currently val() is only a shortcut, but doesn't encapsulate anything useful. It would be nice to have it handling some more stuff. I wouldn't like to have it in an external plugin, that makes it difficult to access or find it when you actually need that functionality. Right

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mark Gibson
Jörn Zaefferer wrote: Currently val() is only a shortcut, but doesn't encapsulate anything useful. It would be nice to have it handling some more stuff. I wouldn't like to have it in an external plugin, that makes it difficult to access or find it when you actually need that functionality.

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Alex Cook
:32 PM To: jQuery Discussion. Subject: [jQuery] $.val() limited in functionality? 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

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Christopher Jordan
. Subject: [jQuery] $.val() limited in functionality? 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

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Dave Methvin
The API says that $.val() will: Get the current value of the first matched element. Yes, it is equivalent to $().attr(value) so it gets the value attribute of the first element. The API says that $.val( string ) will: Set the value of every matched element. Yes, it will set

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jonathan Sharp
On 11/15/06, Jörn Zaefferer [EMAIL PROTECTED] wrote: My conclusion so far: Add attrs(), remove val() and other shortcuts, and allow them via a shortcut function.I agree with this, I think this is the direction to go.-js ___ jQuery mailing list

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
What about select-multiple? This, of course, does not work. val() will return the value of the first selected option in this case. Also note that simply adding a value attribute to something like a div won't work cross-browser. Mike ___ jQuery

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
attr is not an alternative to val. It flat out won't work in FF for textareas, selects or anything w/o a true value attribute. Oops. My apologies. I was using a 1.0 version of jQuery for my test. Ignore the above. ___ jQuery mailing list

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Brandon Aaron
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

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
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.

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Dave Methvin
I'd propose something like $().fieldValue() and $().fieldSerialize be added to the form plugin. Both could take an optional successful only argument indicating if non-successful controls should be ignored. fieldValue() would return the value of the first matched element, in array form if

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
That sounds like a good solution to me. It puts the form code with other form code. I just started using the form plugin today and noticed that it doesn't pass along the error callback in ajaxSubmit. I've changed my local copy but I suspect others might want that as well. That's a great

Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
That sounds like a good solution to me. It puts the form code with other form code. I just started using the form plugin today and noticed that it doesn't pass along the error callback in ajaxSubmit. I've changed my local copy but I suspect others might want that as well. That's a

Re: [jQuery] $.val() limited in functionality?

2006-11-14 Thread Paul McLanahan
I would definitely like to see val() work on any form element. I frankly didn't know that it doesn't. It only makes sense that it would since there would be no point in implementing the function if it only replaces $('input')[0].value. I believe the true power of most of jQuery is the fact that

Re: [jQuery] $.val() limited in functionality?

2006-11-14 Thread Paul Bakaus
I absolutely agree!2006/11/15, Paul McLanahan [EMAIL PROTECTED]: I would definitely like to see val() work on any form element. Ifrankly didn't know that it doesn't.It only makes sense that itwould since there would be no point in implementing the function if itonly replaces $('input')[0].value. I