Bind to onsubmit in form instead