The response for the remote request is wrong:
http://betan.midoo.se/?data%5BUser%5D%5Bemail%5D=bla%40bla.com
That should be just "true", nothing else.

And, completely unrelated: The error message isn't hidden for a valid
field. You can check the state of the field in Firebug. Once its
valid, the error-class is removed. But the error label isn't hidden,
for whatever reason.

To debug this, please include an uncompressed jquery.validate.js file
and enable the debug option (debug:true).

Jörn

On Tue, Apr 14, 2009 at 12:06 AM, Victorr <victor.ry...@gmail.com> wrote:
>
> Sure. I translated the error messages to english so that you would
> understand :)
> http://betan.midoo.se
>
> On 13 Apr, 16:28, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
> wrote:
>> Could you post a testpage? Can't see anything wrong in the snippets
>> you provided - its probably something seemingly unrelated.
>>
>> Jörn
>>
>> On Sun, Apr 12, 2009 at 4:18 PM, Victorr <victor.ry...@gmail.com> wrote:
>>
>> > Ok. But what do i need too echo to get a false value and an error
>> > message?
>>
>> > thanks!
>>
>> > On 12 Apr, 10:37, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
>> > wrote:
>> >> You need to echo "true" for a valid value.
>>
>> >> Jörn
>>
>> >> On Sun, Apr 12, 2009 at 1:02 AM, Victorr <victor.ry...@gmail.com> wrote:
>>
>> >> > I'm using CakePHP, jQuery and the validation plugin. I'm having some
>> >> > problems. I'm trying to check if a email is already in use but I can't
>> >> > seem to get it too work.
>>
>> >> > I'm just trying to get a error message to see that it works but I
>> >> > can't seem to get it right.
>>
>> >> > Javascript:
>>
>> >> > $(document).ready(function() {
>> >> >        $("#UserIndexForm").validate({
>> >> >                rules: {
>> >> >                        "data[User][email]": {
>> >> >                                required: true,
>> >> >                                email: true,
>> >> >                                remote: "/"
>> >> >                        },
>> >> >                        "data[User][passwrd]": {
>> >> >                                required: true,
>> >> >                                minlength: 5
>> >> >                        },
>> >> >                },
>> >> >                messages: {
>> >> >                        "data[User][email]": {
>> >> >                                required: "Du måste ange en e-post 
>> >> > adress.",
>> >> >                                email: "Du måste ange en giltig e-post 
>> >> > adress.",
>> >> >                                remote: "E-post adressen du angav är 
>> >> > upptagen."
>> >> >                        },
>> >> >                        "data[User][passwrd]": {
>> >> >                                required: "Du måste ange ett lösenord.",
>> >> >                                minlength: "Ditt lösenord måste vara 
>> >> > minst 5 tecken."
>> >> >                        }
>> >> >                }
>> >> >        });
>> >> > });
>>
>> >> > And the controller:
>>
>> >> >                if ($this->RequestHandler->isAjax() && 
>> >> > !empty($_REQUEST['data']
>> >> > ['User']['email'])) {
>> >> >                        $valid = 'false';
>> >> >                        echo $valid;
>> >> >                }
>>
>> >> > Thanks!

Reply via email to