How to ask a warning confirmation on save ?

I have a model, I'm creating a new record, if the validation is ok after pressing Save I need to add some other checks and if a condition is true to ask the user if he wants to confirm the save or annull.

I think to put this check in beforesave function by overriding it, but I don't know how which is the correct way in Yii to ask the confirmation to the user and then proceed to the save or annull the operation.

Someone can help me?


You may consider using ajax: when clicking 'save' button, the form is submitted using ajax which returns either error messages or confirmation message. On the client side, you either display the error messages appropriately or display the confirmation dialog and then trigger a normal POST request to save the model.

Thanks for your reply, but it's not so clear for me how to realize it, I've never used Ajax, can you give me a draft of example thank you

That should be your homework. ;)