improve form code url generation and link

the url is generated so that it works in development
and in production.  The link opens the form in a new
window.