There is a modal window inserted into it.
The frame displays a card. When saving a card you need:
1) Save the card
2) Close the modal window

window took from here

example 2.

card closure implemented in the card

<a id=\"button\" href='?$_SESSION[table]#showimagelink' target=\"_parent\">x</a> 

and separately there is a sumbit button which saves the card.
question how to tie all this rubbish on 1 button

    1 answer 1

    1) When creating a modal window, create an id for it.
    2) Pass this id to the frame (for example, through $ _GET).
    3) When saving in a frame, check:

     if(window != window.parent) window.parent.closeThisDialog(__id__);