Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread Fil
> My personal preference would be to move the form plugin methods into
> core, remove core's existing serialize method and introduce a
> "serializeToString" (or something like that) that has a string return
> type in the form of "name=value&name=value".  All this would increase
> the size of core, but only by 2k before packing.
> 
> I'd love to hear opinions on this.

For what it's worth, we have just integrated jQuery into SPIP as a standard
feature (yes!), and the file contains jquery+form, packed.

-- Fil


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


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread Rey Bango


Mike Alsup wrote:
> The recent increase in questions about form serialization and form
> submission makes me wonder the following about why the form plugin is
> not used more:
> 2.  Did you not know it exists?

This was the reason that I didn't use it in my most recent project. I've 
since seen the plugin and wish I had know about it sooner.

> My personal preference would be to move the form plugin methods into
> core, remove core's existing serialize method and introduce a
> "serializeToString" (or something like that) that has a string return
> type in the form of "name=value&name=value".  All this would increase
> the size of core, but only by 2k before packing.

I would love to see it included in the core, especially if the size 
impact is minimal. I would *not* want the other serialization methods 
removed as this effectively prevents people from upgrading if they've 
taken advantage of an existing method. EasyDOM already feel prey to this 
and won't work with JQuery v1.0.1.

My 2 cents.

Rey...


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


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread Jörn Zaefferer
Mike Alsup schrieb:
> My personal preference would be to move the form plugin methods into
> core, remove core's existing serialize method and introduce a
> "serializeToString" (or something like that) that has a string return
> type in the form of "name=value&name=value".  All this would increase
> the size of core, but only by 2k before packing.
>
> I'd love to hear opinions on this.
>   
I think that would be a good idea. For the ones who currently use core + 
form, the file size would be reduced. And it would be much easier to use 
for all those who simply haven't heard, or rather, read, about the form 
plugin.

Rey Bango schrieb:
> I would *not* want the other serialization methods 
> removed as this effectively prevents people from upgrading if they've 
> taken advantage of an existing method. EasyDOM already feel prey to this 
> and won't work with JQuery v1.0.1.
>   
Currently both serialize methods have the same signature, but different 
return types. I guess it would be less pain to keep the old serialize 
like it this and rename the form serialize. On the other hand, it would 
be less confusing to have a serialize() and serializeAsString() or 
serializeQuery(). Or maybe serialize() - returns an array, and 
serialize('&') - returns the form as a string joined with an ampersand. 
I'd prefer a solution that works in a long term. As long as this is 
introduced with a major release with proper release notes, it shouldn't 
be a big problem to upgrade.

-- Jörn

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


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread limodou
On 9/25/06, Mike Alsup <[EMAIL PROTECTED]> wrote:
> The recent increase in questions about form serialization and form
> submission makes me wonder the following about why the form plugin is
> not used more:
>
> 1.  Is it not meeting your needs?

Not too much.

> 2.  Did you not know it exists?

Yeah.

> 3.  Do you prefer not to use plugins?

No, I'd like to.

> 4.  Something else?
>
> I also wonder if its 3 methods should just be added to core.  It's
> been pointed out that core's serialize method is somewhat lacking.

Yeah, I think so. You can see this thread:
http://jquery.com/discuss/2006-September/012200/

> The form plugin's serialize method handles every case that I've seen
> questioned on this list.  Unfortunately, the two serialize methods
> differ in their return types which probably adds more confusion.  But
> rather than beef up core's serialize method why not converge the two
> now and eliminate this confusion?

I don't see there is something deal with multiple-select situation in
forms.js. And serialize( ) in form.js, you return a hash value, and
this will only hold one value if the input element has the same name.
So I'd like your below idea "introduce a serializeToString", and I
think it's better. But in my thread I also point that param() method
in jQuery core will only receive jQuery object or hash, but not a
string at all. And I think param() method should also be changed.
>
If these things also can be merged in form.js, I think I'll use it.

Just some personal opinions.

-- 
I like python!
UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou

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


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread Mike Alsup
> I don't see there is something deal with multiple-select situation in
> forms.js. And serialize( ) in form.js, you return a hash value, and
> this will only hold one value if the input element has the same name.
> So I'd like your below idea "introduce a serializeToString", and I
> think it's better. But in my thread I also point that param() method
> in jQuery core will only receive jQuery object or hash, but not a
> string at all. And I think param() method should also be changed.

Hi limodou,

The serialize method in forms.js handles multiple-select fields just
fine.  It does not return a hash, it returns an Array.  Each selected
option element is added to the array.  I have a test page that shows
this in action here: http://www.malsup.com/jquery/form/

Cheers.

Mike

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


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread limodou
On 9/25/06, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > I don't see there is something deal with multiple-select situation in
> > forms.js. And serialize( ) in form.js, you return a hash value, and
> > this will only hold one value if the input element has the same name.
> > So I'd like your below idea "introduce a serializeToString", and I
> > think it's better. But in my thread I also point that param() method
> > in jQuery core will only receive jQuery object or hash, but not a
> > string at all. And I think param() method should also be changed.
>
> Hi limodou,
>
> The serialize method in forms.js handles multiple-select fields just
> fine.  It does not return a hash, it returns an Array.  Each selected
> option element is added to the array.  I have a test page that shows
> this in action here: http://www.malsup.com/jquery/form/
>
> Cheers.
>
Ok, I tested also, and it's my fault, I'm sorry. And I think the
form.js should be move to core. That's great. And I'll use form.js to
replace my code.

-- 
I like python!
UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou

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


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread Dylan Verheul
On 9/24/06, Mike Alsup <[EMAIL PROTECTED]> wrote:
> I also wonder if its 3 methods should just be added to core.

I think this would be a good idea. People to know Prototype (and
perhpas other frameworks) expect form functionality. As Mike said,
core is lacking in some features that form does very well.

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


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread ashutosh bijoor
My vote is a resounding YES!And am also suggesting NOT to put the form deserialize plugin I wrote in core :-)BTW, curious to know answers to Mike's questions about the deserialize plugin -Ashutosh
On 9/25/06, Dylan Verheul <[EMAIL PROTECTED]> wrote:
On 9/24/06, Mike Alsup <[EMAIL PROTECTED]> wrote:> I also wonder if its 3 methods should just be added to core.I think this would be a good idea. People to know Prototype (and
perhpas other frameworks) expect form functionality. As Mike said,core is lacking in some features that form does very well.___jQuery mailing list
discuss@jquery.comhttp://jquery.com/discuss/-- Reach1to1 Communicationshttp://www.reach1to1.com
[EMAIL PROTECTED]98201-94408
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread Klaus Hartl
Hi Mike,

I too vote for putting the form plugin to the core.


> The recent increase in questions about form serialization and form
> submission makes me wonder the following about why the form plugin is
> not used more:
> 
> 1.  Is it not meeting your needs?

No.


> 2.  Did you not know it exists?

No


> 3.  Do you prefer not to use plugins?

No.

> 4.  Something else?

I am simply to lazy to having to switch to another plugin and so far my 
own solution works and I don't have to support multiple selects yet.


-- Klaus

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


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread Mike Alsup
> BTW, curious to know answers to Mike's questions about the deserialize
> plugin

Hi Ashutosh,

Regarding your question,

1. I think your deserializer is a great plugin and I expect to use it
in the future but I haven't had an actual use case for it yet.  So it
hasn't been a matter of it not meeting my needs but rather just not
needing it (yet).

2. I knew it existed and had saved a local copy back in July.

3. I don't have any preference against using plugins.  I use several
on a regular basis.

To those following this discussion, the only reason I suggested moving
the form plugin into core was because there are so many questions
about form management and there seems to be an expectation that jquery
will solve these problems out of the box (which is not an unreasonable
expectation in my opinion).

Also, to clarify, the form plugin is not my plugin.  I was involved in
some of the discussion earlier this year but the form plugin was
really a collaborative effort by many, largely driven by Mark
Constable.

Cheers.

Mike

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


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread Rey Bango
Hi Jorn,

> ...As long as this is 
> introduced with a major release with proper release notes, it shouldn't 
> be a big problem to upgrade.

I disagree with this statement. If my codebase is dependent on a 
specific type of return value from a method and I've used that method in 
numerous places in my code, upgrading will not be a trivial task 
depending on how I've used the return value.

I refer back to EasyDOM that, at the moment, will only work on v1.0a. 
The upgrade to v1.0.1 broke the functionality. Further, I recall an 
email that I sent out early this month that referred to the set() 
method, which is used in EasyDOM, to which John replied letting me know 
that it had been superseded by attr(). This affected EasyDOM and I'm 
sure others that took advantage of the original method.

I understand the need to enhance the library but there has to be a 
better way of moving forward without simply (or arbitrarily) deprecating 
methods. I would really like some thought given to how this would be 
done. I'm using serialize() extensively now in my current project and 
would hate to have to modify code when alternatives to implementing the 
form plugin exist.

Rey




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


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread Dave Benjamin
On Mon, 25 Sep 2006, Rey Bango wrote:

> I refer back to EasyDOM that, at the moment, will only work on v1.0a.
> The upgrade to v1.0.1 broke the functionality. Further, I recall an
> email that I sent out early this month that referred to the set()
> method, which is used in EasyDOM, to which John replied letting me know
> that it had been superseded by attr(). This affected EasyDOM and I'm
> sure others that took advantage of the original method.

You can create an alias for set() like this:

if (!$.fn.set) $.fn.set = $.fn.attr;

I agree that breaking backward compatibility like this is a bit 
frustrating. However, it was a pre-release, so I'd say John picked a 
reasonable time to do it.

Dave

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


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread Rey Bango
Thanks Dave. I think as long as its not a regular occurence (breaking 
backward compatibility) and its well thought out, then it shouldn't be 
an issue.

Rey...

Dave Benjamin wrote:
> On Mon, 25 Sep 2006, Rey Bango wrote:
> 
> 
>>I refer back to EasyDOM that, at the moment, will only work on v1.0a.
>>The upgrade to v1.0.1 broke the functionality. Further, I recall an
>>email that I sent out early this month that referred to the set()
>>method, which is used in EasyDOM, to which John replied letting me know
>>that it had been superseded by attr(). This affected EasyDOM and I'm
>>sure others that took advantage of the original method.
> 
> 
> You can create an alias for set() like this:
> 
> if (!$.fn.set) $.fn.set = $.fn.attr;
> 
> I agree that breaking backward compatibility like this is a bit 
> frustrating. However, it was a pre-release, so I'd say John picked a 
> reasonable time to do it.
> 
> Dave
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 

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


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread ashutosh bijoor
hey  mike, thanks for taking the trouble to answer!regarding backward compatibility - a necessary evil - along ur line of thought, maybe we can have small backward-compatibility layers that can be peeled off if and when the user  gets a chance to upgrade his/her code 
-ashutoshOn 9/25/06, Mike Alsup <[EMAIL PROTECTED]> wrote:
> BTW, curious to know answers to Mike's questions about the deserialize> pluginHi Ashutosh,Regarding your question,1. I think your deserializer is a great plugin and I expect to use it
in the future but I haven't had an actual use case for it yet.  So ithasn't been a matter of it not meeting my needs but rather just notneeding it (yet).2. I knew it existed and had saved a local copy back in July.
3. I don't have any preference against using plugins.  I use severalon a regular basis.To those following this discussion, the only reason I suggested movingthe form plugin into core was because there are so many questions
about form management and there seems to be an expectation that jquerywill solve these problems out of the box (which is not an unreasonableexpectation in my opinion).Also, to clarify, the form plugin is not my plugin.  I was involved in
some of the discussion earlier this year but the form plugin wasreally a collaborative effort by many, largely driven by MarkConstable.Cheers.Mike___
jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/-- Reach1to1 Communications
http://www.reach1to1.com[EMAIL PROTECTED]98201-94408
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread Rey Bango
Agreed and that would be really beneficial.

Rey...

> thought, maybe we can have small backward-compatibility layers that can 
> be peeled off if and when the user  gets a chance to upgrade his/her code
> -ashutosh



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