Quote funnel embed: prefill (multiple properties)

by steadily

HTML

<ul>
  <li>A simple button to start quote flow</li>
  <li>Opens a full-page modal</li>
  <li><b>Pre-filled quote information such as property address</b></li>
  <Li>Can by styled with your CSS</Li>
</ul>

<h1>
  Property selector
</h1>
<select id="property-selector">
  <option value="property1">property1 descriptor</option>
  <option value="property2">property2 descriptor</option>
</select>

<h1>
  Debug
</h1>
<div class="result">This result will be replaced when property is changed</div>

<script>
  const propertySelector = document.querySelector('#property-selector');
  propertySelector.addEventListener('change', (event) => {

    const el = document.querySelector('form [name="property_details__street_address"]')
    if (propertySelector.value == 'property1') {
      el.value = "6301 Mountainclimb Dr"
    } else {
      el.value = "1555 Random Rd"
    }

    const result = document.querySelector('.result');
    result.textContent = `You chose ${el.value}`;

  });

</script>

<h1>
  Buttons
</h1>
<script src="https://demo.steadilypartner.com/partner/v3.js" async defer></script>

<!-- 
Modal Configuration
    - product: "landlord-insurance", "renters-insurance"
    - data-show-modal-on-load: "0" or "1", 0 is a closed modal, 1 automatically opens the model
    - button-text: string, text to be displayed in the button that triggers the modal

Data Attributes
    - external_record_id: unique id per property that partners can pass in for meta data collection

    - primary_insured__first_name: string, first name of the lead seeking insurance
    - primary_insured__last_name: string, last name of the lead seeking insurance
    - primary_insured__company_name: string, the name of the company associated with the lead
    - primary_insured__email: email field, email address provided by the lead
    - primary_insured__phone_number: phone number field, phone number provided by the primary insured
    - primary_insured__date_of_birth: Date in format "YYYY-MM-DD", the date...