beforeValidate with JS doesn't work

Hello all!

I write some code with CActiveForm:


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

		'action'				=> Yii::app()->createUrl('payment/create'),

		'id'					 => 'add-balance' ,

		'htmlOptions'			=> array( 'name' => 'AddBalance' ) ,

		'enableClientValidation' => true ,

		'clientOptions'		  => array(

			'validateOnSubmit' => true ,

			'beforeValidate'=>'js:function() {

			alert();

			}',

		) ,

	) );

But alert isn’t show. Can you help me?

Most probably it does get executed… but alert() does nothing (does not open any dialog) :D

try with


alert("test");

if you want to see the dialog.