Externalize onsubmit events.