hi there.
usually (cakephp 1.1) we can differentiate errors with something like
this:

        function beforeValidate() {
                // controlliamo se stiamo aggiornando un record oppure nuovo
                if ($this->id === false || $this->id === null) {
                        // nuovo inserimento
                        if (isset($this->data['User']['confirm_password']) &&
$this->data['User']['password'] !=
$this->data['User']['confirm_password']) {
                                // controllo della conferma password in fase di 
registrazione
                                $this->invalidate('confirm_password');
                        }

                        if ($this->findCount(array('User.username' =>
$this->data['User']['username'])) > 0) {
                                // esiste un utente con questo username, 
dobbiamo invalidare il
campo
                                $this->invalidate('username_unique');
                        }

and so on, in our views:

                                <?php echo $html->input('User/username', 
array('id' =>
'User_username', 'size' => '30')) ?>
                                <?php echo $html->tagErrorMsg('User/username', 
'Inserire un
username valido e di almeno 4 lettere.') ?>
                                <?php echo 
$html->tagErrorMsg('User/username_notvalid', 'Questo
username non pu� essere utilizzato.') ?>
                                <?php echo 
$html->tagErrorMsg('User/username_spambot', 'Il sistema
ti ha riconosciuto come uno spambot. Contatta il supporto tecnico.') ?>

now I'm switching to the new validation and the new form helper
(cakephp 1.2).
can please somebody tell me how to differentiate errors with the form
helper?
I know that we can use 'error' => 'my error message' during widget
construction, but this is one and generic message instead of the
default "field is required".

hope that makes sense.
thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to