Add pre-validation on button

issue4121
review7471002