If you are able to create a new window to get detailed information from the user, then you must be able to get the detailed interactions of his. For example, if you created a new dialog box and which in turn returns the value (which you would use further). You can check that value to be null or useful.
if(valueReturned != null && valueReturned == useful) {
}
But, apart from this I would recommend that you try to not close that dialog until user has provided you with a valid data. If user has not provided data, terminate the process at that time. This way, instead of checking the returned value and disabling the button you will be able to prompt the user for value at that stage itself. :)