Okay
  Public Ticket #2744336
Phone number field prefilled
Closed

Comments

  • Julia Böckh started the conversation

    When booking an appointment we made the phone number mandatory.

    When someone selects a country flag/country code, a phone number (which is mandatory) is prefilled which the user has to type over. This happens in both firefox as well as internet explorer. The fact that a phone number is shown in this field, totally confuses the users. When selecting Germany it shows 01512 3456789 and for Switzerland it will show 078 123 45 67. Any idea how we can make sure the text box for the phone number remains empty?

  • [deleted] replied

    Hi, Julia!

    Thank you for choosing Amelia.

    Please try to add this JavaScript to the page with Amelia:

    <script>
      window.beforeConfirmBookingLoaded = function () {
        var field = document.querySelector("#am-confirm-booking > div:nth-child(1) > form > div.am-confirm-booking-data.el-row > div:nth-child(6) > div > div > div > input");
     
        setTimeout(function () {
          field.setAttribute('placeholder', '');
        }, 500);
     
        var elements = document.getElementsByClassName("el-select-dropdown__item");
     
        for (var i = 0; i < elements.length; i++) {
          elements[i].addEventListener(
            'click',
            function() {
              field.setAttribute('placeholder', '');
            }
          );
        }
      }
    </script>

    Hope that will resolve the issue.

    Best Regards. 

  • Julia Böckh replied

    Fantastic! That did the trick for us! Thank you :)

  • [deleted] replied

    Hi, Julia!

    I'm happy I could helpsmile.png

    Please feel free to contact us if you have any other questions.

    Best Regards. 

  •  1
    Marketricks replied

    Thanks Liza!