Hello,
I would like to create a form field, which will receive the current page url it was launched from, or even better - the exact section in the page. The field should be hidden and sent with the form when it’s being submitted.
Is that doable?
Hi @Naama, it is not possible to do that natively yet via the forms widget, but you can put an embed widget into your form, just above the Submit button.
In the embed, paste this code, which will dynamically create the hidden input field called pageURL and save the current url as part of the form data submitted:
Thank you very much for your answer @cyberdave.
Unfortunately, it’s not working, it looks like it’s not reading the javascript at all. Maybe I should include something in the ?
Hi @Naama, thanks for the update. I took a look at the embed with the script I sent you, and that seems ok, but when I try to open the request a demo form, an error message is generated that also shuts everything else down too:
My suggestion is to fix this error first, get the form working so that it pops up and is possible to fill in a form submission. Could you look at this error on the form popup first, then once that is working, it is easier to see if there is some problem during the form submit process.
I’ve fixed this bug and now it seems like the form is working, I receive a thank you page after it’s being submitted.
The only thing that’s wrong is that it’s not creating a lead in Salesforce unless I add the “debug” and “debugEmail” fields to the form.
Do you have any idea why is this happening?
Hi @Naama, I am sorry, I really do not know that answer to that question :-/
Webflow is not doing anything tricky or special here, we only POST the form data in a standard way.
The fields you setup in the Webflow form will be posted to the target specified in the ACTION property.
How that is processed once posted is on Salesforce side, so the thing to do is to check what documentation they may have on that. Maybe there is some test mode or something you are in on their side. Not sure really, but good thing to check
Just so I understand, are you wanting to dynamically get the Section ID the form is nested within?
The example I provided was a basic example how to capture the page url dynamically. If you already know the section ID, you can also concatenate the strings to form a working url to the section:
If you need further help, you might need to get some custom coding work done for this. A good suggstion is to reach out to some jquery gurus out there for help a custom solution.