breakout javascript in form.html so it can be overridden by plugins