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!