Force ajax validation when button is clicked


I have an activeForm with ajaxValidation. The ajaxvalidation runs when tab to another field or clic outside. That’s ok.

Now, I want force ajaxvalidation when the submit or link button is clicked. For example, when the link is clicked, it calls to validate() function and if this is ok, then call to a controler.

Sorry for my english and thanks!

You may use this extension. you have to call validate() function on server side.

Check the options for CActiveForm, you can set validateOnSubmit to true.