Customize the Form
Customize the Form from the Dashboard
You can now customize the form from Cotter's Dashboard > Project > Design.

Customizable Features that are not available in the Dashboard:
Advanced Configuration Reference
You can use our advanced config to have more functionality:
Usage:
Config:
Here's an example of a complete configuration:
Description
Field Name
Description
Required
ApiKeyID
your API_KEY_ID
Y
Type
"EMAIL" or "PHONE"
Y
ContainerID
id of the <div> where you want to serve Cotter Form.
Y
ButtonBackgroundColor
Button background color. Use HEX format (e.g. #000000)
N
ButtonTextColor
Button text color. Use HEX format (e.g. #FFFFFF)
N
ButtonText
Button text. Default is "Sign Up Without Password"
N
Additional fields that you want to include in the JSON obj. Check the specs for Additional Fields Object below
N
IdentifierField
Field name for the identifier to include in the JSON obj. For example, if you want to include the phone number in the JSON obj under key "phone", then fill in IdentifierField = "phone"
Y
A function that will be called before the signup process begin. Check the specs for OnBegin below
N
PhoneChannels
An Array of channels to send verification code to your users. Default value is ["SMS"].Available values are SMS and WHATSAPP. For example, to allow both SMS and WhatsApp, specify ["SMS", "WHATSAPP"]
N
Additional Fields
The additional fields will be used to generate more <input> fields for your users. The format is as following:
Available types:
hidden,text,number
This will be sent to you to the RedirectURL endpoint above as part of the JSON object. For example, with the fields above, you'll get a JSON object like the following.
JSON Object to be sent to RedirectURL:
OnBegin
This function will be invoked before the Signup/Login process. You will receive the following payload as a parameter to your function
Payload passed into your OnBegin function
You can do a check against the identifier here before the form is submitted.
If you include OnBegin key, you have to either return an error string, or return null if you want to continue the authentication process:
A. If you want to continue submission:
B. If you want to stop submission with an error:
Example:
CountryCode
The default value is CountryCode: ["+1"];
If you specify this, you have to use an array even though you only need 1 country code!
ex. with 1 country code
ex. with 2 country codes
Our SMS and WhatsApp messaging works worldwide!
Last updated