Thank you Dieter and Paul,
Yes I got the good javascript code.

I am thinking, may be the problem comes from the profile creation.
Here is my code for add.thtml to add a user:

echo $dAuth->loadJs();
echo $dAuth->ErrorMsg($action,$error);
if($this->params['bare']):
echo $ajax->form('/users/add/','post',array('update'=>
'update_form','loading'=> "Element.show('loading')",'complete'=>
"Element.hide('loading')"));
else:
echo $dAuth->formHeader($action,$formAction,$allowcleartext);
endif;
?>
<fieldset>
<legend>Ajouter un usager</legend>
        <div class="set-column">
                <div class="label">
                        <label>Role:</label> requis
                </div>
                <div class="input">
                        <?php echo $html->selectTag('User/auth_group_id', 
$roles,
$html->tagValue('User/auth_group_id'), null, null, false);?>
                </div>
                </div>
<div class="set-column">
                <div class="input">
                <?php echo $dAuth->formInput('Surnom','User/username');?>
                </div>
        </div>
        <div class="set-column">
                <div class="input">
                        <?php
echo $dAuth->formPassword('Password','User/password');
           echo $dAuth->hiddenField('hashed_pw','User/hashed_pw','');
?>
                </div>
        </div>
<div class="submit" style="margin-left:120px;">
        <?php echo $dAuth->submit('Enregistrer', false);?>
</div>
</fieldset>
</form>

and here is the method in users_controller.php :

        function add() {

        $this->set('roles', $this->Group->generateList(null, null, null,
'{n}.Group.id', '{n}.Group.name'));
        $this->set('allowcleartext', $this->dAuth->allowClearText);
        $this->layout = 'ajax';
        if (!empty($this->params['data'])) {
$this->data['User']['username']=$this->nettoyer($this->data['User']['username']);
$this->data['User']['name']=$this->nettoyer($this->data['User']['name']);
$this->data['User']['email']=$this->nettoyer($this->data['User']['email']);
$this->data['User']['password']=$this->data['User']['hashed_pw'];

                        if ($this->User->save($this->params['data'])) {
                        $this->flash('Usager ajouté.','TB_remove');
}
}
}

the nettoyer() method is used to get rid of any accent.

Thank you

Jean


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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