I was able to solve this issue.
I was trying to add the button on a staging site using wp staging. Because the WAF was being controlled by the production site, I was not given the option to allow the blocked action. I disabled the WAF on the production site and was then able to save the confirmation with the button onclick.