Before refreshing the form after a form is changed, doing client-side validations