Skip to main content

Displaying Member Data with Data Attributes

Josh Lopez
Josh Lopez
  • Updated

You can display member data on your site using Memberstack data attributes. This allows you to show information like a member's email, name, signup date, and any custom fields you have created. 

1) Email

Use data-ms-member="email" to display or submit the member's email address. For example: 

<div data-ms-member="email"></div> <input type="email" data-ms-member="email"> 

2) Password

Use data-ms-member="password" as an input to allow members to submit their password. For example:

<input type="password" data-ms-member="password"> 

3) Signup Date

Display the member's signup date with data-ms-member="signup-date". For example:

<div data-ms-member="signup-date"></div> 

4) Custom Fields

Show custom field values using data-ms-member="CUSTOM_FIELD_ID", replacing CUSTOM_FIELD_ID with your actual custom field ID. For example:

<div data-ms-member="custom-field-1"></div> 

This allows you to display fields like names, addresses, company, etc.

5) Other Attributes

Additional attributes are available for specific use cases:

  • data-ms-member="token" - Used to submit reset password tokens
  • data-ms-member="current-password" - Allow changing passwords by submitting current password
  • data-ms-member="new-password" - Allow setting a new password

For example, to allow resetting a password with a token:

<form> 
  <input type="text" data-ms-member="token"> 
  <input type="password" data-ms-member="new-password"> 
</form> 

And to allow changing passwords:

<form> 
  <input type="password" data-ms-member="current-password"> 
  <input type="password" data-ms-member="new-password"> 
</form> 

Was this article helpful?

Didn’t find your answer?

Get an instant answer from Rey, or reach a human. Either way, we’re happy to help.

Comments

No comments yet. Start the conversation below.

Please sign in to leave a comment.

Sitemap