Seans solution may work, but if not you can use the new SaveBeforeNavigating class, assuming you have a rich text button as you mentioned. Generic example below.
var text URL = myURL
<a class='SaveBeforeNavigating' style=\"text-decoration:none; background: #688EB3; border-radius: 5px; color: #ffffff; display: inline-block; padding: 4px 0px 0px 0px; width:145px; height:22px; text-align: center; text-shadow: none; border: 0px solid #030404; font-size: 12px \"href='"
& $URL
& "'>Button Words Here</a>"
------------------------------
Mike Tamoush
------------------------------