I have two same forms (duplicates) in different folders since each folder can be accessed by selected group of people. Now I want to get rid of duplicate and just keep one file. However, I want this file to be able to find out from which folder the user accessed the file and redirect back to the folder he came from at the end of successful submission.
Any ideas?
The easiest way is probably to add a hidden field to the form for the referring page:
This can then either be set using any server side code, or with javascript when the page with the form on loads: