Hello,
I am currently building a form using Wix Form. In there I have a hidden form field I want to use to Track Refferal to the page. I first wanted to pass the Current URL to test my code before changing it to pass the query and then produce multiple queries for my different referral sources. This is my current code:
import wixLocation from 'wix-location'; let url = wixLocation.url; $w('#wixForms1').onWixFormSubmit((event) => { $w('#ref').value = url }) However, upon submission the field in my submission table associated to the '#ref' that should pass the URL is empty. Where am I going wrong?
They're the ready-made form application provided by Wix. They can receive value by code I believe but the .onReady command does not work with them basically...
Should I link it to a dataset then? Because .onReady works with wixData and not wix forms?
Instead of putting the value assignment in .onWixFormSubmit() event handler, put it in $w.onReady(() =>/*here*/ );