Accessing input data from a form field with Javascript

Hi,

How can I access the value that a user entered and it was stored inside a form field variable with javascript?

If I do:

var representante = $("#representante").attr(“ms-data”);

I get the name of the field and not the data inside the field.

Thanks

1 Like

I found the solution!

https://help.memberstack.io/post/front-end-api

How to access member information with JS
MemberStack.onReady.then(function(member) {
// do things with the member object
member[“email”]
member[“name”]

// member’s specific page if set.
member.memberPage

// check if member is logged in
member.loggedIn // returns true or false
})

Thanks

2 Likes

Thanks for sharing the solution :partying_face: