Recently I have asked a question I wasn't able to find already asked: How to add behavior-based onclick to ajax-enabled Form API button?
Now, they are similar for sure. But are they duplicates? If so, which one should get closed? I dare to shamelessly say that it appears I've put a bit more effort in my question. And the answer to the older one simply does not work for me.