ajax submit active form

i have an active form and i want to submit the form using ajax. is there any way how this can be achieved ? as we can of course validate an active form using the following code:

    if(Yii::$app->request->isAjax==true){


        $model = new Gratitude();


        if($model->load(Yii::$app->request->post())){


            $model->userId = Yii::$app->user->identity->id;


            $model->created = time();


            Yii::$app->response->format = 'json';


            return \yii\widgets\ActiveForm::validate($model);


            Yii::$app->end();


        }


    }

But i also want to submit the active form using ajax and show the success message to the user like we have errorSummary using ajax validate. is there any method after successful submission of the active form i want to perform some operations how can this be accomplished ?