Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
1
Indexable
Never
<script>
      const NAME = '';
      const USERNAME = '';
      var addCustomField = function () {
        let nameField = `<div class="field"><div class="field__input-wrapper custom" id="name-field"><label class="field__label field__label--visible" for="contact-name">Name:</label>
        <input data-is-error="true" data-custom-input="true" placeholder="Name" value="${NAME}" autocorrect="off"  class="field__input" aria-required="true" type="text" name="checkout[attributes][Contact Name]" id="contact-name" >
        </div></div>`;
        
        let username = `<div class="field"><div class="field__input-wrapper custom" id="phone-field"><label class="field__label field__label--visible" for="phone-number">Number Phone:</label>
        <input data-is-error="true" data-custom-input="true" placeholder="Username" value="${USERNAME}" autocorrect="off"  class="field__input" aria-required="true" type="text" name="checkout[attributes][Phone Number]" id="phone-number">    
        </div></div>`;
        $('.section--contact-information .fieldset').prepend(username);
        $('.section--contact-information .fieldset ').prepend(nameField);
      };
       addCustomField();
    </script>