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 condition first and
then making an AJAX call manually only if needed...

On Apr 17, 4:16 pm, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:
> 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 <g...@riga.ahlers.com> wrote:
>
> > I've been trying to use remote method coupled with depends, like this:
>
> > remote: {
> >        depends: function(element) { element.value = $.trim(element.value);
> > return element.defaultValue != element.value; },
> >        url: 'my.php',
> >        type: 'post',
> >        data: { action: 'check_user_name' }
> > }
>
> > and this doesn't work, because the whole remote parameter array gets
> > overwritten with the result of evaluating my 'depends' function (so
> > instead of array it becomes a scalar, true or false). Therefore in
> > case of false the AJAX call doesn't happen, and in case of true an
> > error occurs (because there's no url, no type, and no data anymore).
>
> > I assume remote and depends are incompatible, is it correct? If yes,
> > is there a workaround for this?
>
> > TIA
> > cheers

Reply via email to