Add form validation for modal dialog