Custom SignUp Page

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?

Hello,
can anyone know customizing sign up page?

Hi @Amalendu,

Have you done anything for customizing signup page?

@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.

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.

2 Likes

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

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.

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

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

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?

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

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

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; });

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

1 Like

@saurabh2804

1 Like

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.

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.

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.

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

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