When a user submits a form, how can we automatically obtain the url of the page?The form is on the product page.I want to automatically obtain the link or product name of the product when the user submits the form.
Hello.
If you've added a custom form via the Form Manager, you can do this by adding a hidden input field to your form, then filling it with JavaScript when the page loads.
Hi Basara,
where should we put the javacript?
Hello.
Put the JavaScript in an HTML block and assign that block to the page layout where the form is shown.
There are other ways to add JavaScript too, such as directly in the template files, but using an HTML block is usually the easier method for this kind of task.