We just purchased Amelia last week. Our service requires that we pre-populate fields in the appointment booking form with custom user meta data.
We have created custom fields in Amelia and successfully pre-filled them automatically using simple jQuery. However, while the fields are populated in the browser, the values does not seem to register with the plugin?
When submitting/trying to submit the form, populated fields triggers a required notice even though they are not empty, and non-required fields show up empty in the booking emails.
Only when i manually fill out fields or edit the pre-filled values are they recognized by the plugin.
I have never come across this issue before. Please advice.
$('#am-confirm-booking .am-cf-1 .el-textarea__inner').text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.').change(); });
$('body').on('change', '.select-horse', function() { var horse = $('.select-horse option:selected').text(); text = $('body .am-cf-7 .el-input__inner');
So what im trying to do is that when i select a time slot and click continue, i generated a select-input field (the available options will be generated dynamically in the final version). the selected option is then copied to an Ameila custom text-field.
I have also auto filled a textarea with sample text.
As you can see in the screen recording, both imput fields register as empty unless i manually edit them or interact with the field first before changing them.
Seems like Vue is making som kind of dirty/validation check each individual form field that only triggers on manual input. I have tried triggering a change with multiple methods, including vanilla js, but no luck.
Is there an easy way o bypass this check or trigger the dirty flag programmatically?
<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>
this works great with the Booking Form 1.0. Is there a way to use such an approach for Step by Step Booking Form 2.0? Because the beforeConfirmBookingLoaded is not fired there.
We just purchased Amelia last week. Our service requires that we pre-populate fields in the appointment booking form with custom user meta data.
We have created custom fields in Amelia and successfully pre-filled them automatically using simple jQuery. However, while the fields are populated in the browser, the values does not seem to register with the plugin?
When submitting/trying to submit the form, populated fields triggers a required notice even though they are not empty, and non-required fields show up empty in the booking emails.
Only when i manually fill out fields or edit the pre-filled values are they recognized by the plugin.
I have never come across this issue before. Please advice.
Thank you,
Hello,
Thank you for reaching out to us.
Can you please provide us with the jQuery code that you used to populate the custom fields?
Looking forward to your reply.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and 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
<script>
(function($) {
$('body').on('click', '#am-button-wrapper-0', function(){
$('#am-confirm-booking .am-cf-7 .el-form-item__content').append('<select class="select-horse">' +
'<option selected disabled>Select...</option>' +
'<option>Option 1</option>' +
'<option>Option 2</option>' +
'</select>');
$('#am-confirm-booking .am-cf-1 .el-textarea__inner').text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.').change();
});
$('body').on('change', '.select-horse', function() {
var horse = $('.select-horse option:selected').text();
text = $('body .am-cf-7 .el-input__inner');
text.val(horse).change();
});
})(jQuery);
</script>
So what im trying to do is that when i select a time slot and click continue, i generated a select-input field (the available options will be generated dynamically in the final version). the selected option is then copied to an Ameila custom text-field.See this screen recording: http://convertor.se/files/screenrecording.mov
I have also auto filled a textarea with sample text.
As you can see in the screen recording, both imput fields register as empty unless i manually edit them or interact with the field first before changing them.
Seems like Vue is making som kind of dirty/validation check each individual form field that only triggers on manual input. I have tried triggering a change with multiple methods, including vanilla js, but no luck.
Is there an easy way o bypass this check or trigger the dirty flag programmatically?
Hello,
Thank you for clearing that up.
I have passed this issue to over level 2 support team and we will provide you with an update as soon as we have one.
Thank you for your patience.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and 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,
This has since been forwarded to our developers and we will provide you with an update as soon as we have one.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and 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,
Here is an update from our developers.
You can use the following script:
You need to call this method:
Hope this works for you.
Feel free to contact us if you have any other questions.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and 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
Thank you!
I will give this a try.
Hello,
Please provide us with an update on whether it works or not.
Looking forward to your reply.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and 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,
this works great with the Booking Form 1.0. Is there a way to use such an approach for Step by Step Booking Form 2.0? Because the beforeConfirmBookingLoaded is not fired there.
Thanks
Hello Nino,
Thank you for reaching out to us.
Can you please create a separate ticket and we will assist you with this?
Looking forward to your reply.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and 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