We're Moving to a New Support Platform – Starting June 1st!

We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.

You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.

While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.

We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.

Thanks for your continued support and trust – we’re excited to bring you an even better support experience!

Okay
  Public Ticket #2687094
Autofill Form with Query
Closed

Comments

  • Julien Schürer started the conversation

    Hello,

    is it possible to autofill a amelia booking form with a link with a query.

    For example: www.test.com/?firstname=Peter

    So that the field first name gets auto filled with the name Peter.

    Thank you very much

    Julien

  • [deleted] replied

    Hello Julien, 

    Thank you for your purchase.

    Yes, you can try using this script for achieving that:

    <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>
    https://localhost/ameliafull/index.php/booking/?firstName=John&lastName=Doe

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.