malsup wrote:
>
> Not sure what you meant about
> the array of values returned from fieldValue (it returns an array for
> selects or checkboxes).
>
It looked to me (I could be wrong) that if I have 10 text inputs of the same
name, I will only get the value of the first one if I do a fieldValue(). Is
this incorrect?
malsup wrote:
>
> Are you planning to write a plugin to support the features you
> mentioned?
>
Most definitely. Even if it's not popular, I would at least use it for
myself. I've used my own code for so long that I'm most comfortable with its
interface and behavior, so that's the big incentive for me. I have separate
modules now for form functions (value, default value, setting value,
ischanged, etc), for selectbox manipulation (move options up and down, sort,
add, remove), for check box groups, for dependent select boxes, and
transferring options between select boxes. So I definitely don't have to
start from scratch. I just have to revisit and rework some of the code I
already have (it needs cleaned up anyway).
My goal would be to tweak these stand-alone modules but not make them
exclusively jQuery. Instead, add a check at the bottom to see if jQuery is
also being used, then plug those methods into the jQuery object.
Something like:
var Form={
getValue: function(field) { ... }
}
if (jQuery) {
jQuery.fn.getValue=function() {
var v=[];
for (var i=0, max=this.length; i < max; i++) {
v.push(Form.getValue.call(Form,this[i]));
}
return v;
}
}
Please forgive me if that's _way off_ from how it should work, I haven't
really read through the Plugins docs yet so I'm only guessing and using a
bit of your code ;)
But this way, the library can be used either stand-alone or as a jQuery
plugin. Someone could extend it to work with their own framework of choice
as well. For basic functionality, I just don't see a reason to tie the core
logic to a specific framework. Other than losing the ability to use jQuery's
functionality within the module logic, is there any reason not to take the
strategy above?
Ah, and FWIW, I think the jQuery community should standardize on all plugins
taking the name jSomething, just for consistency. It always looks way more
cool when all plugins and extensions have the same naming structure. Makes
the whole thing look like a more cohesive unit rather than a jumbled bunch
of modules, IMO :)
Matt
--
View this message in context:
http://www.nabble.com/jQuery-Design-Decisions--Comparison-to-MooTools--tf3218550.html#a8958367
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/