Get the current URL

Get the current URL


After spending hours on the last simple thing, thought to ask this community
instead of playing for hours and hours when someone probably already knows how to do this.

I want to have a form field that gets the current URL dynamically of wherever the form is embedded store the url and show the link in the view - possibly with fixed text (or a button) on the view rather than lengthy URLs. Allowing the user to click and it will return to the page where the form was originally filled in. i.e. it is a link back.

I intend on using this form in many different places within a site and using many forms is not really viable.

Any ideas or help appreciated.

John