Just added an ajaxSubmitButton to my view and I cant call a javascript function which I can call with a normal submitButton.
Here is the code for the button
CHtml::ajaxSubmitButton(Yii::t('dictionary', '_add_track'), Yii::app()->createUrl('track/new/'.$project_id),
array(
'type'=>'POST',
'dataType'=>'json',
'success'=>'function(data){
if(data.status =="success"){
alert("success");
}else{
removeError();
$.each(data, function(key, val) {
$("#viewrate-comment-input").addClass("error");
$("#newtrack-form #"+key+"_em_").text(val);
$("#newtrack-form #"+key+"_em_").show();
})
}
}'
)
and I am getting the error that my javascript function is not a function.
It still makes no sense why it works with a normal submitButton.
Hope someone can help me out here.