Not Working for Formilator
-
The Formilator form building plugin generates different field IDs each time the page refreshes. So inputting the ID doesn’t work because it is different the next time the form loads.
Does anyone have any workaround or solution?
- This topic was modified 1 year, 6 months ago by nazmuslabs.
-
@nazmuslabs sorry for late response, just a bit caught up with other stuff. For now, you can use a work around and I will push it next update so that similar issues don’t occur.
With Forminator, even though the ID changes the first part of the field stays the same. So you will need to choose the first part of the field ID.
For Example, the field id is “forminator-field-street_address-address-1_647580ceeb5c3”
You add the forminator-field-street_address-address-1 in the field ID list.
You also need to modify the code in the plugin.
Go to Plugin File Editor under Plugins option.
The select the Simple Address Autocomplete from top right corner.
Then click “public“
Then “js“
Then “simple-address-autocomplete-public.js“
Then remove everything after line 41 and replace with the following code.
for (let i = 0; i < inputSplit.length; i++) { inputValues[i] = inputSplit[i]; // Select the fields with the prefix using the starts with (^=) attribute selector fields = document.querySelector(
[id^="${inputValues[i]}"]
); if (fields) { simpleAutocomplete = new google.maps.places.Autocomplete(fields, options); } } } window.addEventListener('load', function () { for (let i = 0; i < inputSplit.length; i++) { inputValues[i] = inputSplit[i]; // Select the fields with the prefix using the starts with (^=) attribute selector const fields = document.querySelectorAll([id^="${inputValues[i]}"]
); fields.forEach(field => { field.setAttribute("onfocus", "initAutocomplete()"); }); } });This should work. Also remember, the plugin only supports single line address and will NOT fill the City, State, Country etc.
Let me know if this helps.
@nazmuslabs I just pushed an update (version 1.2.1) now you only need to add the prefix of the field ID and it should work fine. (No need to change the code)
Please test it and let me know if it resolves the issue.
Thanks
Greetings!
Thanks for getting back to me! I am pleased to inform you that after the update, which already incorporates the code you asked me to modify above, now allows forminator form field to work correctly, Alhamdulillah (Praise God). Thank you so much for taking the time to address this.
Coffee’s on me; I’ll buy you a coffee as appreciation when I get some time to spare, Insha’Allah (God Willing)!
May Allah (S.W.T.) guide you and bestow upon you His blessings; Ameen.
@nazmuslabs great to hear it worked for you. Thank you.
hello! Possibble me help me not working Contact Form 7, i regist Google Maps API Key
@olahferenc27 you must assign an ID to contact form 7 fields. CF7 doesn’t automatically assign an ID so you have to do it manually. See this: https://saa.khadim.nz/kb/how-to-add-address-autocomplete-to-contact-form-7
Sorry but not working!
útvonal Megadasá1/2 Honnan
[text some-id-name] Hová
[text field-header2 placeholder "Gy?r/Budapest/Hatvan/Miskolc/Nyíregyháza/Debrecen"]
[text text-208 id:address_id_field]
Indulás dátuma:
[date date-774 min:2023-08-31 placeholder “Kérjük válassza ki az indulás dátumát”] Vissza indulás dátum (Nem k?telez? kit?lteni!):
[date date-265 min:2023-08-31 “Nem k?telez? kit?lteni!”] Utaslétszám:
[select menu-599 “1” “2” “3” “4” “5” “6” “7” “Teljes busz 8 f?re”] Kér-e plussz poggyászt:
[select menu-560 “Nem kérek” “+1 poggyász max 20kg”]
field ids:
text-208
text-208
field_id_name
address_id_fieldsorry!now working! But search after stop, please check https://newtransfer.hu/services/utasszallitas/
@olahferenc27 the plugin is working fine, however, your APIs are not enabled properly. Make sure you enable Maps Javascript API and Places API.
See this for help: https://saa.khadim.nz/kb/how-to-get-google-maps-api-key
This API key is not authorized to use this service or API. Please check the API restrictions settings of your API key in the Google Cloud Console to ensure that all of the APIs and services you need to use are correctly specified in the list of enabled APIs.
Hello! I do all, and i make a billings, and make all api accept, but not good
<input size=”40″ class=”wpcf7-form-control wpcf7-text pac-target-input gm-err-autocomplete” id=”address_id_field” aria-invalid=”false” placeholder=”Hoppá! Hiba t?rtént.” value=”” type=”text” name=”text-208″ onfocus=”initAutocomplete()” autocomplete=”off” disabled=”” style=”background-image: url("https://maps.gstatic.com/mapfiles/api-3/images/icon_error.png");”>
You are getting the following error:
The current URL loading the Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key in the Cloud Console.
I don’t think you have added the URLs to the list. Follow the following instructions and add the following URLs to the Referrer list under Website Restrictions.
newtransfer.hu
newtransfer.hu/*
*.newtransfer.hu
*.newtransfer.hu/*Follow these instructions: https://saa.khadim.nz/kb/how-to-get-google-maps-api-key#optional-settings
Im very not happy not working… ??
- The topic ‘Not Working for Formilator’ is closed to new replies.