[jQuery] Re: [validate] remote vs depends

2009-04-17 Thread snobo
Thanx a ton for the ultra-quick reply & help! Worked like a charm, I did it like this: rules.UserName = { xRemote: { condition: function(element) { element.value = $.trim (element.value); return element.defaultValue != element.value; },

[jQuery] Re: [validate] remote vs depends

2009-04-17 Thread Jörn Zaefferer
Ok, that makes it a bit more difficult. For a workaround, try something like this: $.validator.addMethod("customRemote", function(value, element) { if (!remoteRequired(element) { return "dependency-mismatch"; } return $.validator.methods.remote.apply(this, arguments); }, $.validator.mes

[jQuery] Re: [validate] remote vs depends

2009-04-17 Thread snobo
well, I don't see how required can help me... what I want is to make a remote call/check ONLY under certain circumstances. Plus, this field is "constantly"-required already anyway... actually, now I think there might be various workarounds, e.g. creating a custom method, which would check the con

[jQuery] Re: [validate] remote vs depends

2009-04-17 Thread Jörn Zaefferer
This is indeed a bug, in this case something never tested for. Is using required: function() {} together with remote an option? Jörn On Fri, Apr 17, 2009 at 3:03 PM, snobo wrote: > > I've been trying to use remote method coupled with depends, like this: > > remote: { >        depends: function