You should style the code first. Can often help to find errors.
Now what you could do is (as far as I understood it correctly):
PHP Code:
function ButtonBeenPressed.onAction() {
DoEvent();
//For example: you pressed the confirmation button (you need to change the name on this event for that
}
function DoEvent() {
player.chat = "Hell jea I just pressed that wonderful button.";
//here you can do your stuff, you want the player to do after confirming
}