Prefilling Forms

Specific input elements (DOM nodes) can be marked to be prefilled by the widget

The available data types can be found here

Examples

Text inputs (input type="text", type="email", type="hidden", textarea)

<div>
  First Name:
  <input
    type="text"
    data-ms-member-info="firstName"
  />
  Last Name:
  <textarea
    data-ms-member-info="lastName"
  >
  </textarea>
</div>

Text and number type fields will be rendered normally Select (radio) type field value will be used to fill out the input Multiple select field selected values will be comma and space separated ("apple, pear") Checkbox type fields will be rendered as "Yes" or "No", translated per the selected language

Radio buttons (input type="radio")

<div>
  Text signup field:
  <div>
    Blue:
    <input
      type="radio"
      value="blue"
      data-ms-member-info="customSignupField22"
    />
  </div>
  <div>
    Red:
    <input
      type="radio"
      value="red"
      data-ms-member-info="customSignupField22"
    />
  </div>
  <div>
    Green:
    <input
      type="radio"
      value="green"
      data-ms-member-info="customSignupField22"
    />
  </div>
</div>

The value attribute needs to match exactly (case sensitive) to the stored value in order to be selected

<div>
  Dropdown:
  <select data-ms-member-info="customSignupField22">
    <option value="blue">Blue</option>
    <option value="red">Red</option>
    <option value="green">Green</option>
  </select>
</div>

The value attribute needs to match exactly (case sensitive) to the stored value in order to be selected

Checkbox (input type="checkbox")

<div>
  Checkbox:
  <input type="checkbox" data-ms-member-info="customSignupField34" />
</div>

The checkbox will only be updated if the referenced custom input is also of checkbox type

Last updated

Was this helpful?