Receiving form data with localeID

Hi,
I am receiving form data in MAKE via the webflow app. In addition to all the form information, I would like to know which locale the form was used from, so I can route the requests according to the locale language.
Any ideas how to pass along that data?
Thanks so much for your help.
Tobias

The LocaleID would take some work but you can easily write some script to grab the lang= attribute from the <html> element, and then pass it into your form as a hidden field.

That gets your the locale language and region codes e.g. en-US which is a bit more readable.

1 Like

@memetican Thank you. I wouldnā€™t know how to pull that information.

But, I have tried this script, which I am successfully using in another webflow form (that uses logic to transmit the data).

<script>
document.forms['newsletter_signUp'].elements['language'].value = 'de'
</script>

This current form does not use logic. It works simply as a form and then the webhook gets triggered and is then received by the webflow module in make.

The ā€˜languageā€™ field however remains empty in the transmited bundle.

Youā€™d have to double check the names of your form and your hidden input element, since thatā€™s what your code depends on.

Also itā€™s not getting the current language, but rather always de. I might not be understanding what youā€™re trying to build.

Logic works differently as you cannot use input type=hidden there, you must use a Webflow input element, and then set it to display: none.

Michael, thank you for your help.

All names match.

Yes, as a simple solution I have manually entered ā€œdeā€. When I switch the webflow locale in the designer to English, I can actually change ā€œdeā€ to ā€œenā€ in the script. That appears to be supported. In the German locale the script then reads ā€œdeā€ and in the English locale it reads ā€œenā€.

However regardless that workaround, the field does not receive that input. I added an input element to the form, named it, set the display to none. Just to double check, I published the form with the field visible but it is empty.

Youā€™re missing something. Without digging into it and building a solution ( direct message me if you would like to discuss rates ), the only possible glitch I can guess is that maybe you have your script in the head instead of the body, and the elements youā€™re setting donā€™t exist yet when the script runs.

1 Like