<< Back to Blog Posts

How to add Custom Fields for Registration

With Bread & Butter, you can set custom fields that your users are asked to enter after they register. For example, you may want to know their company name, phone number, company size or industry.

After your users complete the login process, they’ll see a dialog like the following:

Some key features of the custom fields for registration dialog:

For example, if you want to add 2 text boxes, a mandatory checkbox, and have custom text, this is what you would add under BreadButter.configure :

locale : { “CUSTOM_DATA”: { “HEADER”: “Thanks for Signing Up”, “SUB_HEADER”: “We just have a few questions we’d like to ask you”, “SUBMIT”: “Submit”, “MANDATORY”: “This field is mandatory.” } }, custom_data: [{ custom_key: ‘company_name’, display_name: ‘Company Name’, type: ‘textbox’, mandatory: false, }, { custom_key: ‘phone’, display_name: ‘Phone Number’, type: ‘textbox’, mandatory: true, }, { custom_key: ‘agree_toc’, display_name: ‘I agree to the <a href=”www.google.com” target=”_blank”>terms & conditions</a>’, type: ‘checkbox’, mandatory: true, default_value: true } ]

For the display content in the locale object:

For the actual registration fields:

Once you’ve constructed the fields and display information you’d like to set (using the format in the example above), simply add the code to the initialization script, under the App ID.