Form Submit Without Page Refreshing

I render form on modal.

I want to code for click Submit (1. yii save data in to mysql 2. if save success close the modal.) without page refreshing.

help me please.

Thank you very much.

What’s the problem you’re facing with writing such code?

Generally you need:

  1. Use jQuery to handle click and send AJAX request.

  2. Handle this request on server side.

  3. Close modal on response.

JQuery.post