Prefilling Forms

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

To not overwrite potential changes the member makes to the prefilled values, filling of these inputs will only be done once, immediately after they are rendered, or after a member logs in.

If a member logs out, and another member logs in, the values will not be updated!

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