[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-20 Thread Dan G. Switzer, II
José, >Logical implies a => ba is true if b is true, false in other case. >Then this is a simple example form: >(* is obligatory) >*name: ___ >*surname: >send by postal mail: [X] <-- checkbox >postal address: ___ > >So, if I check "send by postal mail", impl

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-20 Thread SeViR
Jörn Zaefferer escribió: SeViR schrieb: Somewhere in the documentation you should find a comment stating that the temptation to add a regex method is great, but should be resisted. I still think that its better to add custom methods that implement those regular expression instead of one gene

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dan G. Switzer, II
Jörn, >I like the idea.Gonna test if that works out. > >About the xor-validation, I wonder if this could work: > >$.validator.addMethod('xor', function(value, element, parameter) { > return value && $(parameter).is(":blank"); >}); > >rules: { > field1: { xor: "#field2" }, > fiel

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb: Aaron, I may be misunderstanding something, but what does this do that $.validator.addMethod[1] doesn't? The addMethod would accomplish the same thing. The addMethod() is really affective for building a library of reusable validation method. However, ther

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dan G. Switzer, II
Aaron, >I may be misunderstanding something, but what does this do that >$.validator.addMethod[1] doesn't? The addMethod would accomplish the same thing. The addMethod() is really affective for building a library of reusable validation method. However, there are times when you have very specifi

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Aaron Heimlich
I may be misunderstanding something, but what does this do that $.validator.addMethod[1] doesn't? [1] http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatoraddMethodStringFunctionString On 4/19/07, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote: Jörn, >Sorry, my example was a bi

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dan G. Switzer, II
Jörn, >Sorry, my example was a bit misleading. So far you can't pass a function >as a rule, only as a value to required. >supported: field: { required: function() {} } >not supported: field: function() {} > >By adding support for the latter, you could do almost everything, but >I'm not yet sure h

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Jörn Zaefferer
SeViR schrieb: I would need some methods ("rules" in YAV) in Validation plugin: // generic regexp method $.validator.addMethod("regexp", function(value, element, regular_expression) { return (typeof(regular_expression) == "string")? value.match(new RegExp(regular_expression)) : val

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb: Jörn, You can do that already. After implementing the suppurt for expressions, support for plain functions was really easy. I can imagine adding a method on the fly: rules: { field2: function() { return condition; } } I wasn't aware of that. Howev

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread SeViR
I would need some methods ("rules" in YAV) in Validation plugin: // generic regexp method $.validator.addMethod("regexp", function(value, element, regular_expression) { return (typeof(regular_expression) == "string")? value.match(new RegExp(regular_expression)) : value.match(regular_e

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dan G. Switzer, II
Jörn, >You can do that already. After implementing the suppurt for expressions, >support for plain functions was really easy. I can imagine adding a >method on the fly: > >rules: { > field2: function() { return condition; } >} I wasn't aware of that. However, if you changed that do: rules

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb: Jörn, This would make field2 required only if field1 is blank: rules: { field2: { required: "#field1:blank" } } But I can't express that either field1 or field2 is required. How would I express that using pre/post-condition and implies? I was thinking a

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Jörn Zaefferer
Dmitrii 'Mamut' Dimandt schrieb: Jörn Zaefferer wrote: Dmitrii 'Mamut' Dimandt schrieb: Jörn Zaefferer wrote: I'm gonna take a look at that library for some inspiration. And maybe copy some validation methods (called rules at yav). Let me know if you have any specific reques

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dmitrii 'Mamut' Dimandt
> > I guess what you want is something like: > > rules[1]='field1|equal||pre-condition'; > rules[2]='field2|regexp|^a-zA-Z$|post-condition'; > rules[3]='1|implies|2|Enter either field 1 or field 2'; > > rules[4]='field2|equal||pre-condition'; > rules[5]='field1|regexp|^a-zA-Z$|post-condition'; >

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dan G. Switzer, II
Jörn, >This would make field2 required only if field1 is blank: > >rules: { > field2: { required: "#field1:blank" } >} > >But I can't express that either field1 or field2 is required. How would >I express that using pre/post-condition and implies? I was thinking about this the other day, and I

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dmitrii 'Mamut' Dimandt
Jörn Zaefferer wrote: > > Dmitrii 'Mamut' Dimandt schrieb: >> Jörn Zaefferer wrote: >> >>> I'm gonna take a look at that library for some inspiration. And maybe >>> copy some validation methods (called rules at yav). >>> >>> Let me know if you have any specific requests for the jQuery >>> valida

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Jörn Zaefferer
Dmitrii 'Mamut' Dimandt schrieb: Jörn Zaefferer wrote: I'm gonna take a look at that library for some inspiration. And maybe copy some validation methods (called rules at yav). Let me know if you have any specific requests for the jQuery validation plugin. That would be the pre-condi

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dmitrii 'Mamut' Dimandt
Jörn Zaefferer wrote: > I'm gonna take a look at that library for some inspiration. And maybe > copy some validation methods (called rules at yav). > > Let me know if you have any specific requests for the jQuery > validation plugin. > That would be the pre-condition, implies and post-condition. T

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Jörn Zaefferer
SeViR schrieb: Dmitrii 'Mamut' Dimandt escribió: SeViR wrote: Wow. Thank you for the link to YAV, http://yav.sourceforge.net/ that I found on the university site. This is amazing! YAV is a fantastic JavaScript Form Validation library with a pair of years of develop. By now, we use this l

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Rey Bango
This is excellent news, Jose. Me alegro tanto que ha decidido utilizar jQuery! :) We look forward to seeing the results of your projects and contributions to the jQuery effort. Thanks again! Rey Bango jQuery Project Team SeViR wrote: Hi there, recently I presented a seminar of JavaScri

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Abel Tamayo
Congrats, Jose Francisco. jQuery FTW! On 4/19/07, SeViR <[EMAIL PROTECTED]> wrote: Dmitrii 'Mamut' Dimandt escribió: > SeViR wrote: > > Wow. Thank you for the link to YAV, http://yav.sourceforge.net/ that I > found on the university site. This is amazing! > YAV is a fantastic JavaScript Form V

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread SeViR
Dmitrii 'Mamut' Dimandt escribió: SeViR wrote: Wow. Thank you for the link to YAV, http://yav.sourceforge.net/ that I found on the university site. This is amazing! YAV is a fantastic JavaScript Form Validation library with a pair of years of develop. By now, we use this library in join

[jQuery] Re: The University of Murcia (Spain) takes jQuery as main JS Library for all new projects

2007-04-19 Thread Dmitrii 'Mamut' Dimandt
SeViR wrote: > > Hi there, > > recently I presented a seminar of JavaScript programming with jQuery > in The University of Murcia (Spain) and the results are very good. > > http://www.um.es/atica/mncs/forja (sorry in *spanish*) Wow. Thank you for the link to YAV, http://yav.sourceforge.net/ that