Check if event is default prevented before triggering submit on form