yilliot
(Yilliot)
1
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
$(‘form’).submit(function(){
$('#loadingWrapper').show();
});
it show the loading bar even though the validation is failed and form not submitted…

yilliot
(Yilliot)
2
yii developers… no solution? am i forced to give up using active form? 
yilliot
(Yilliot)
3
i found this… solve my problem
'clientOptions'=>array(
'validateOnSubmit'=>true,
'afterValidate'=>'js:formSend',
),
<script type="text/javascript" charset="utf-8">
function formSend(form, data, hasError)
{
if (!hasError) {
$('#loadingWrapper').show();
return true;
};
}
</script>