fix an issue w/ submitting when the dialog is invalid

This fixes a few issues related to submitting a dialog with invalid fields:
- override `onClick` in spark dialog buttons, to ensure that we do not send the onclick event for disabled buttons
- check dialog validity before we submit via a 'trigger on return' field. Before, you could submit a dialog that had a disabled submit button, via hitting return in a 'trigger on return' text field.
- add the ability for spark dialogs to respond to whether it is valid

fixes #2322; @ussuri
Since you've added this, it could be reused in `_updateFormValidity` below.