How can I trigger client-side validation "manually"?

I have a CActiveForm with some fields which are validated client side. I need to trigger client-side (javascript) validation from a custom javascript function when I click a link. Is there any way to do this? Something like:


<a href="someurl.html" onclick="executeValidators(params)">Validate me!!!!!</a>

where [font="Courier New"]executeValidators[/font] is my function which should trigger client-side validation, something like this:


function executeValidators(someParams) 

{

   // client-side validators are executed here...

}

Any help is appreciated.

Same problem here. Any hints?

Did you ever find a solution for this?

Hi please see forum

like


<span onclick="javascript:checkErrors();" class="gray_button"> 

                        <?php echo CHtml::submitButton('Save'); ?>

</span>

I hope it’s some help.

The CActiveForm have a property named $enableClientValidation which determine to enable client-side data validation. Defaults to false.

http://www.yiiframework.com/doc/api/1.1/CActiveForm#enableClientValidation-detail