ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Custom SignUp Page


#1

Hello Everyone,
I want to add custom fields to user Signup page. For eg, instead of giving Fullname and Emailid and getting the message “Registration Details Emailed”, I would like to give some more data like ‘type of User’, Gender, DOB etc. Doing so Admin may be able to assign User Role dynamically depending on the type of user like Customer or Trader. And then the registration details can be sent to the user!
Anybody know how to customize signup page?


Customized signup
Customized signup
#2

Hello,
can anyone know customizing sign up page?


#3

Hi @Amalendu,

Have you done anything for customizing signup page?


#4

@royprotim: we have some experience with adding Facebook and Google+ sign up options for ERPNext. However, we have not had any experience of extending the sign-up form fields itself. This is one of the core capabilities of ERPNext, and a lot of things are touhed/affected by the attempt to customize it here.


#5

Thank You very much @gvyshnya for your suggestion but what I want is to add some custom fields in the current signup system. e.g, an extra field for phone number along with the already present email field in the signup form.


#6

Where can I find the signup template and .py files in the project folder?


#7

Hi,
in ERPv7 it’s in frappe.www.login.html and frappe.www.login.py. I suppose you can create login.html in your application and it can use you login.html but I am not sure.


#8

Thank you for your reply. Can you tell me where can I find the entered login/signup credentials?


#9

sorry what did you mean? whose credentials? you don’t know your credentials?


#10

No No, I mean that whatever data that is entered, how can we retrieve them to customize the signup. Suppose I add an extra field on the signup form say phone number, how can I put that in the database?


#11

you should check templates/includes/login/login.js if you use ERPv7


#12

Thank You @SwitsolAG for your reply, but that is only for the validations.


#13

Probably you should check how it works and then can see how you can make it with your custom field.
I suppose in this part you can see how it takes value for signup
$(".form-signup").on("submit", function(event) { event.preventDefault(); var args = {}; args.cmd = "frappe.core.doctype.user.user.sign_up"; args.email = ($("#signup_email").val() || "").trim(); args.redirect_to = get_url_arg("redirect-to") || ''; args.full_name = ($("#signup_fullname").val() || "").trim(); if(!args.email || !valid_email(args.email) || !args.full_name) { frappe.msgprint(__("Valid email and name required")); return false; } login.call(args); return false; });


#14

Has this been implemented by anyone yet? I am interested in the same since many people don’t like to use their email ID and would rather use a phone number. While a phone number can be easily used for login, there seems to be no straight forward way to use it for signup. Even though I have been able to make changes to the Signup page such that it asks for the phone number, I am not about how to get it to save in the database, such that a registration confirmation may be sent through the SMS. I will set up the SMS gateway later but for now I need the phone number to be saved at the time of signup itself.
Thank you


#15

@saurabh2804


#16

Thank you for the reply. It allows for signin with phone number but I am interested in being able to signup with a phone number, such that phone number is saved right at the time of signup.


#17

Can someone point me to the resources I should be looking at if I want to figure it out. I am from a medical background and am just learning programming. I can look at existing solutions and change them for my use case. If I do, i will post the solution here. Basically I am looking for a way to accept more information from the User, apart from the Email and password at the time of registration itself. It might be helpful in several use cases besides mine.
Thank you.


#18

I found this discussion as being helpful. I will build from here and if successful I will post back here. In the meantime, any help will be really appreciated.
Thank you.


#19

A possible workaround:

  1. Create a custom doctype, which has all the fields you want to collect from the user
  2. Create a web form on that doctype and make it public. Share the link as the signup form
  3. Disable the default user signup from the website
  4. Create a hook that programmatically creates a new user from the information in the doctype when the web form is submitted

#20

Can I get the OTP system to work with that workaround? I want the OTP to be sent by SMS only, not by email.