Adding JS to intercept form submit event