# Prefilling Forms

{% hint style="warning" %}
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!**
{% endhint %}

{% hint style="info" %}
The available data types can be found [here](/embedding/member-information/available-data-types.md)
{% endhint %}

### Examples

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

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

{% hint style="info" %}
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
{% endhint %}

#### Radio buttons (input type="radio")

```markup
<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>
```

{% hint style="info" %}
The value attribute needs to match exactly (case sensitive) to the stored value in order to be selected
{% endhint %}

#### Dropdown (select)

```markup
<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>
```

{% hint style="info" %}
The value attribute needs to match exactly (case sensitive) to the stored value in order to be selected
{% endhint %}

#### Checkbox (input type="checkbox")

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

{% hint style="info" %}
The checkbox will only be updated if the referenced custom input is also of checkbox type
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.memberspace.com/embedding/member-information/prefilling-forms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
