[jQuery] Re: New Field Plug-in...

2007-04-06 Thread Dan G. Switzer, II
>Overwriting core methods is fine as long as you don't change the >contract/behaviour of that method. Just think of a site that uses the >form plugin and a different that relies on the standarf val() behaviour. >An extension that can handle arrays to manipulate selects/checkboxes >would be fine fr

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Jörn Zaefferer
Mike Alsup schrieb: I would opt for a new method name so that existing methods can be deprecated and eventually removed. This is why I'm not a big fan of overriding "val". I think it's too ingrained at this point and a behavior change would be trouble. Even though the return type would be th

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Dan G. Switzer, II
Mike, >I like the idea of a single name for both get/set because it fits well >with the jQuery model. I would opt for a new method name so that >existing methods can be deprecated and eventually removed. This is >why I'm not a big fan of overriding "val". I think it's too ingrained >at this po

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Andy Matthews
lto:[EMAIL PROTECTED] On Behalf Of Dan G. Switzer, II Sent: Thursday, April 05, 2007 12:46 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: New Field Plug-in... Mike, >I'd say either make it an option (along with what the join char is) or >just impl two method, one would call

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Mike Alsup
1) I used the names getValue/setValue mainly because the code is derived from alike methods in qForms. Would it make more sense to use a single method--like fieldValue() (although I'm not sure I like that name?) I like the idea of a single name for both get/set because it fits well with the jQ

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Dan G. Switzer, II
Mike, >I'd say either make it an option (along with what the join char is) or >just impl two method, one would call the other and then do the join. >Plugins shouldn't feel as constrained by file size as the core. > > >> Strings can be more straightforward (but have certain limitations) while >> A

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Mike Alsup
I've toyed around w/using an array instead (I actually build an array, but return a string.) I may toy around w/making it a setting--whether to return arrays or strings. I'd say either make it an option (along with what the join char is) or just impl two method, one would call the other and th

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Dan G. Switzer, II
Andy, >Honestly Dan, I think this is the way that jQuery SHOULD work. If I call >for >the val() of a form control, I shouldn't have to worry about whether it's a >radio button, or a text field. Obviously I can get the value of a specific >radio button, but just give me what's CURRENTLY selected.

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Dan G. Switzer, II
Mike, >Good stuff, Dan. The first thing that jumps to mind is that these >would be nice enhancements to the form plugin. getValue is very >similar to fieldValue. I like the logic of your getValue better but I >like the idea of returning the array instead of the string (and let >the caller join

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Dan G. Switzer, II
Jörn, >What type is returned for checkboxes and multiple-selects? An array? At the moment (and you can test this yourself) it would be a comma delimited string. This is the one issue I'd knew I heard feedback on. As I stated in another message, there's advantages/disadvantages to both. >You co

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Andy Matthews
Honestly Dan, I think this is the way that jQuery SHOULD work. If I call for the val() of a form control, I shouldn't have to worry about whether it's a radio button, or a text field. Obviously I can get the value of a specific radio button, but just give me what's CURRENTLY selected. andy ---

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb: Last night I threw together a quick plug-in that can be used to get/set the value of any form field. This works with checkbox, radio and select elements--which the val() method doesn't handle. I basically just took the core from an old JSAPI I wrote (qForms) and grab

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Mike Alsup
Good stuff, Dan. The first thing that jumps to mind is that these would be nice enhancements to the form plugin. getValue is very similar to fieldValue. I like the logic of your getValue better but I like the idea of returning the array instead of the string (and let the caller join it on what

[jQuery] Re: New Field Plug-in...

2007-04-05 Thread Rey Bango
Dan, This is VERY cool and extremely useful. Great work. You should add a section to PengoWorks for the jQuery stuff you're building. Rey Dan G. Switzer, II wrote: Last night I threw together a quick plug-in that can be used to get/set the value of any form field. This works with checkbox,