Thank you all,
Yes Dieter and Paul, I got the right javascript code.
I am thinking my problem comes from the part where I create a profile,
cause I had first a misconception of the app. Here is the code from
add.thtml:

<?php
$action = 'Add';
$formAction = $html->url('/users/add/');
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 one from the add() method in users_controller :

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

the nettoyer() method is to get rid of any accent.
Thank you for your help.
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