Check dev console to see data retrieved from the form when closing the modal.
Sample 1
Sample using promises
Complex
Lots of fields