Only submit dialogs if form is valid

Support browser validity checks for input[required] and input[pattern] and the like.