How to add name field on singup page?

207 Views Asked by At

I am using loginradius for one of my project (glossary app), and it is still in development phase but I want to ask name of user on registration page, by default on signup page only email and password fields are available. I don't know how to add name field on signup page. I saw that on singup page I can use JavaScript but not sure how to add fields using JavaScript too?

1

There are 1 best solutions below

0
vyasriday On

You can use JavaScript DOM APIs to create a new name field and use that field for name on your registration page.

step 1: create an input field for name

var input = document.createElement("input");  
input.type = "text";

step 2: Append the input field to your registration form

document.getElementById("your registration form id").appendChild(input);

Now you have extra field available on your registration form which you can use to extract name value and send it to API as post data along with other field values.

Let me know if you need any other help in this.