Ctools nested modals I am familiar using ctools and modal forms. But now I have to implement multiple nested modal forms.
I have a link &quot;Edit contact&quot;, this opens a modal form. At the top of the form I have another link &quot;Delete contact&quot;, which opens a second modal form which asks the user if he/she is sure if he/she wants to delete the contact.
The response of the first modal form (as expected) is in JSON format:

This works nice and easy.
When I click &quot;Delete contact&quot; (second modal form), the response is HTML:

Because of this reponse I get following error:

Help? :)
I think you need to create your own ajax handler for this. The idea would be to check if an existing modal exists and rather than add a new one, simply run a replace in your existing one. If non exists, you'd need to setup a new modal.

The other approach you can take, is rather than just forcing it to opena new one, send an ajax request to close the existing one and then present the new one.

Either way, I do not believe there is an easy or straight solution for this particular problem.