.customfield.add()
Allows you to create a new input field in the chat widget. Custom field inputs will be displayed in visitor information section pane right beside the operator's chat window.
Note:
To push the inputs of the newly created Custom field to CRM, create a new field with the same Custom field name under the Leads/Contacts/Visits module in CRM.
PARAMETERS
name: To set a reference name for the field, which will be displayed in the visitor information section pane right beside the operator's chat window.
hint: Text to be displayed as a hint for the visitors in the chat widget.
type: Type of field to be added.
" text, number, label, checkbox, radio, email, selectbox, percentage, decimal, url, textarea "
required: To set a field mandatory.
true: Mandatory
false: Optional
maxlength: Number of characters allowed for a particular input field. The default value is 30 and the maximum limit is 100.
minlength: Number of characters allowed for a particular input field. The minimum value can be set manually.
visibility: To control the visibility of the fields. The default value is both.
online: Field will be visible only when the agents are online.
offline: Field will be visible only when the agents are offline.
both: Field will be visible always.
options: To provide options for the fields. Supported only for selectbox, checkbox & radio.
text: Label to be displayed.
value: Value procured.
style: To set a style for the label.
font-size: To set the font size for a label.
color: To set the font color for a label.
text-align: To set the font alignment for a label
before: To position the label before a specific field.
after: To position the label after a specific field.
callback: Specify the function to be invoked when a value is set for the field.
Syntax
Copied$zoho.salesiq.customfield.add(
{
"name" :"<Name of the field>",
"hint" :"<Hint for the field>",
"required" :"<true|false>",
"maxlength" :"<Integer (0-100)>",
"minlength" :"<Integer>",
"type" :"<type of field ">",
"visibility" :"<online|offline|both>",
"options" : [{
"text" :"<Text>",
"value":"<Value>"
}]
});
Example
Copied<script>
$zoho.salesiq.ready = function()
{
$zoho.salesiq.customfield.add(
{
"name":"Browser",
"hint":"Browser",
"type":"checkbox",
"options":[
{
"text":"Chrome",
"value":"Chrome"
},
{
"text":"Firefox",
"value":"Firefox"
},
{
"text":"IE",
"value":"Internet Explorer"
}],
"required":"true",
"visibility":"both",
"callback":function(value){ }
});
}
</script>