ask about yii active form validation call back on javascript

hi, i am using CActiveForm and it perform validation while click submit button.

I want to change the submit button to loading icon while form validate success and submit. how should i do that in jquery?


if i do this




it show the loading bar even though the validation is failed and form not submitted…


yii developers… no solution? am i forced to give up using active form? :mellow:

i found this… solve my problem





<script type="text/javascript" charset="utf-8">

function formSend(form, data, hasError)


if (&#33;hasError) {


	return true;