Added option to stop DOM form submit on validate

Fixes #2874