hi rodrigo…
did you think i stopped annoying you? wrong! 
well, that’s my new problem:
i need to validate a form with fields that are not related to a table so i made this class
<?php
class AssegnaCertificatiForm extends CFormModel
{
public $n_certificati;
public function attributeLabels() {
return array(
'n_certificati' => Yii::t('app', 'N certificati da assegnare'),
);
}
public function rules() {
return array(
array('n_certificati', 'required'),
array('n_certificati', 'numerical', 'integerOnly'=>true),
);
}
}
this controller:
array('allow',
'actions'=>array('admin','delete', 'assegna'),
'users'=>array('admin'),
),
...
...
...
public function actionAssegna() {
$model = new AssegnaCertificatiForm();
$this->performAjaxValidation($model, 'assegnacertificatiform-form');
if (isset($_POST['AssegnaCertificatiForm'])) {
$model->setAttributes($_POST['AssegnaCertificatiForm']);
//do something
}
$this->render('assegna', array( 'model' => $model));
}
and this view
<div class="form">
<?php $form = $this->beginWidget('GXActiveForm', array(
'id' => 'assegnacertificatiform-form',
'enableAjaxValidation' => true,
));
?>
<p class="note">
<?php echo Yii::t('app', 'Fields with'); ?> <span class="required">*</span> <?php echo Yii::t('app', 'are required'); ?>.
</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'n_certificati'); ?>
<?php echo $form->textField($model, 'n_certificati'); ?>
<?php echo $form->error($model,'n_certificati'); ?>
</div><!-- row -->
<?php
echo GxHtml::submitButton(Yii::t('app', 'Save'));
$this->endWidget();
?>
</div><!-- form -->
the validation is working (on lostfocus) but not the performAjaxValidation as on the other create actions of other controllers (if the field is empty it does not Yii::app()->end() ).
could you tell me why?
thanks