Client side and submit validation css error messages

Hi there,

I’ve found a problem with validation error messages that’s getting on my nerves. The form is created as follows:




<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'usuarios-app-form',

	'enableClientValidation'=>true

	'clientOptions'=>array(

		'validateOnSubmit'=>true,

	),

)); ?>


<div class="span-7 last">

	<?php echo $form->textField($model,'username');?>

	<?php echo $form->error($model,'username');?>

</div>

...

<?php $this->endWidget(); ?>



When "enableClientValidation" is set to "true", I get a nice and clean error message like in img_nice:3063

img_nice.PNG
How can I make this two options look the same? in other words, how could I make submit validation error message look the same as client side validation error message?

Thanks a lot!

Alejandro.

As by current design the client validation sets the "error" class on the row (i.e. container of the input field), but the server validation sets the "error" class on the input field.

So you just need to set your CSS rules accordingly

P.S. please do not use PM (private messages) for asking help

I have noticed this. The error class on the input field is not what I want.

How can I do that?

Sorry about bothering you with my PM.