Tinker around, test what response and if any, comes back when they close the form. I've forgotten most of this, but look at FormAPI source and see if any packet comes back related to previously mentioned action. Or perhaps it's more easier than I make this: check if $data passed to callback function is null, that might indicate the closing action of the form.
Here's an example code: PHP: public function hiPrimus($sender){ $form = new SimpleForm(function (Player $sender, $data){ if ($data == null){ $this->hiPrimus($sender); return true; } switch ($data) { case 0: break; } }); $form->setTitle("§7How's it going Primus"); $form->setContent("Hello Primus"); $form->addButton("§cHi Primus"); $form->sendToPlayer($sender); }