Put it in the OK button click event.