1

I have a basic contact form set up and working but I've now got to change it to make it support locales. So depending on what language version of the website you are looking at, the form submits to a different address.

So what I have so far is I've set up several forms one for each language with their form handles being contact_en, contact_de etc, which is working fine I get submissions to the different forms. What I haven't got working is the validation, in particular how reference the submitted field and get any errors. In the original working form my form handle was contact, so to reference the field I used contact.fullName, this worked fine.

So now to setup the form initially I'm using:

{% set form = craft.amForms.getForm('contact_' ~ craft.locale) %}

Is there a way to get a handle to the form so I can reference the fields?

I've tried:

{% set formHandle = form.handle %}

This just returns a string, so it fails if I tried to reference a field like this:

{{ formHandle.fullName }}

I'm sure there's a straightforward way of doing it that I'm not seeing! Any help gratefully received.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.