Created a method to deal with the OK button's OnClick.