Julien1384 Posted May 2 Share Posted May 2 Hi, When we translate the options in the dropdown box of the contact form the website doesn't accept the translated version and produces an error: For example on the original version the submitted data goes like this: "select-df09032e-2778-42e9-a51d-2b5488ebbada":"Lecture de mon DH" Meanwhile on the translated English version it goes like this: "select-df09032e-2778-42e9-a51d-2b5488ebbada":"Reading my DH" The system does not expect "Reading my DH" as value. It is only translated the labels in the HTML source code as you can see and not touch the value to avoid such cases. However, the form is being submitted by JavaScript code and the code is reading the translated label instead of the value when sending the data to the backend. Is it possible to adjust the javascript code or to add code in order to read the option value instead of the option label, so there won't be any error while sending the form ? Link to comment
madebydave Posted May 2 Share Posted May 2 Can you share the website link please for context. Squarespace Circle Leader | Squarespace Expert Made by Dave | London, UK View our work at madebydave.org | Available for hire on Squarespace Marketplace | You can also thank me by buying me a coffee ☕. Link to comment
Julien1384 Posted May 2 Author Share Posted May 2 Oh I thought it was in my message https://www.jb-orama.com/ original version https://en.jb-orama.com/ translated version Link to comment
Julien1384 Posted May 7 Author Share Posted May 7 I have tried to add this code into a code block but nothing change. Anyone here would have a solution for this. I guess I'm not the only one having such issue... thanks a lot in advance, <script defer> document.querySelectorAll('#select-df09032e-2778-42e9-a51d-2b5488ebbada-field option')[1].setAttribute('value', "Informations de naissance"); document.querySelectorAll('#select-df09032e-2778-42e9-a51d-2b5488ebbada-field option')[2].setAttribute('value', "Lecture de mon DH"); document.querySelectorAll('#select-df09032e-2778-42e9-a51d-2b5488ebbada-field option')[3].setAttribute('value', "J'ai déjà eu une lecture de DH"); document.querySelectorAll('#select-df09032e-2778-42e9-a51d-2b5488ebbada-field option')[4].setAttribute('value', "Demande de Coaching"); document.querySelectorAll('#select-df09032e-2778-42e9-a51d-2b5488ebbada-field option')[5].setAttribute('value', "Pendule divinatoire"); document.querySelectorAll('#select-df09032e-2778-42e9-a51d-2b5488ebbada-field option')[6].setAttribute('value', "Une nouvelle économie est possible !"); document.querySelectorAll('#select-df09032e-2778-42e9-a51d-2b5488ebbada-field option')[7].setAttribute('value', "Autres"); </script> Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment