Wednesday, December 28, 2011

login validation does not work with $validate

hi,

i have done this several time with register and it works, but this one
is killing me...

my form:
========

<?php
echo $form->create('User', array('action' => 'login', 'id' =>
'userLoginForm'));

echo $form->input('login_username', array( 'label' => '', 'value'
=> '', 'id' => 'UserUsername', 'value' => 'Username') );
echo $form->input('login_pw', array( 'label' => '', 'type' =>
'password', 'id' => 'UserPw') );
echo $form->button('Einloggen', array('type' => 'submit',
'class'=>'button', 'id'=>'loginSubmit'));

echo $form->end();
echo '<div class="error-message"></div>'; //field to be populated by
possible error message

?>


my model:
=========

var $validate = array
(


'login_username' => array(
'rule' => array('validateLogin', 'login_username'),
'message' => 'Falscher Benutzername.'
),

}

//returning false for testing
function validateLogin($data)
{
$valid = false;
return $valid;
}

my controller function login() is empty for testing....is used to have
all the validation in my controller but i didnt like the setFlash()
method for printing the error message, i want to print the messages
ajax like...so i wanna use the $validate

i cant find the problem........

i appreciate the help....thanks :))))

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: