The problem is how to get the url parameter saved in to a custom field?
We have tried using some jQuery to get the value inserted to the field... this also kinda works: https://take.ms/s69Pc but the data is not saved to the field when submitting the form
The case is that we have links to our booking form on different landingpages. It is important for us to know from which landingpage the user has clicked the link to the booking form from.
So we wish to be able to save the referer (page where the users clicked from) together with the booking info.
We tried setting it up so the link had a parameter with the referer url in and tried to use some jQuery to "paste" it in a field in the booking form, but it will not save it.
Is there any way we can get information like this saved to the booking?
Our colleagues have just contacted us. You can achieve this with via jQuery, we send you an example of the script below
<script> var getUrlParams = function (url) { var params = {}; var parser = document.createElement('a'); parser.href = url; var query = parser.search.substring(1); var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); params[pair[0]] = decodeURIComponent(pair[1]); } return params; }; window.urlParams = getUrlParams(window.location.href); window.beforeConfirmBookingLoaded = function () { var firstName = document.querySelector("#am-confirm-booking > div:nth-child(1) > form > div.am-confirm-booking-data.el-row > div:nth-child(3) > div > div > div > input"); var lastName = document.querySelector("#am-confirm-booking > div:nth-child(1) > form > div.am-confirm-booking-data.el-row > div:nth-child(4) > div > div > div > input"); if ('firstName' in window.urlParams) { firstName.value = window.urlParams.firstName; firstName.dispatchEvent(new Event('input')); } if ('lastName' in window.urlParams) { lastName.value = window.urlParams.lastName; lastName.dispatchEvent(new Event('input')); } } </script>
You probably missed this:
lastName.dispatchEvent(new Event('input'));
This example captures parameters from the URL, and enters them on the Form in the Input fields. You missed this line to save the fields.
Hi
We wish to be able to save the referer url the user comes from when using the booking form.
We have tried to add the referer url us an url parameter to the url of the booking form like this: https://domain.com/book/?reference=/product/productname123/
The problem is how to get the url parameter saved in to a custom field?
We have tried using some jQuery to get the value inserted to the field... this also kinda works: https://take.ms/s69Pc but the data is not saved to the field when submitting the form
Can you help with getting this to work?
Thanks and best regards
Hello Janus,
Thank you for purchasing our product, and for reaching out to us.
When went on the page that you have sent us the page was missing
I'm afraid that we didn't quite get what do you mean exactly can you please explain it to us in a little more detail?
Looking forward to your reply.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Marko
The domain was just as an example :)
The case is that we have links to our booking form on different landingpages. It is important for us to know from which landingpage the user has clicked the link to the booking form from.
So we wish to be able to save the referer (page where the users clicked from) together with the booking info.
We tried setting it up so the link had a parameter with the referer url in and tried to use some jQuery to "paste" it in a field in the booking form, but it will not save it.
Is there any way we can get information like this saved to the booking?
Hello Janus,
We have forwarded your ticket to our developers and as soon as we get some feedback from them we will contact you immediately.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Janus,
Our colleagues have just contacted us. You can achieve this with via jQuery, we send you an example of the script below
You probably missed this:
This example captures parameters from the URL, and enters them on the Form in the Input fields. You missed this line to save the fields.
Hope this helps.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Awesome Marko. This worked perfectly!