Hello, I am trying to add additional fields to my sign up form. What I am trying to do is add phone, address, full name and checkbox tag information.
I have looked at the documentation with Lock and other ways, but it is really unclear how to do this. I am using a fully custom build form that works with sign up/login. I have looked at the lock code
dditionalSignUpFields: [{
name: "address",
placeholder: "enter your address",
// The following properties are optional
icon: "https://example.com/assests/address_icon.png",
prefill: "street 123",
validator: function(address) {
return {
valid: address.length >= 10,
hint: "Must have 10 or more chars" // optional
};
}
},
{
name: "full_name",
placeholder: "Enter your full name"
}]
but don’t know how to add it here ( to the signup function)
function signup() {
var button = this;
var email = document.getElementById('email').value;
var password = document.getElementById('password').value;
button.disabled = true;
webAuth.redirect.signupAndLogin({
connection: databaseConnection,
email: email,
password: password,
captcha: captcha.getValue()
}, function(err) {
if (err) displayError(err);
button.disabled = false;
});
}
I am just looking for a way to add additional sign up fields to my form, to be sent to the backend.
An example code would be very helpful.
Thank you.