Customised input fields

Below is an example code (in the script tag) where the chatter is prompted for name and email address, and the input fields are mandatory before being able start the chat. Remember that the attributes using default values does not have to be defined, even if they can be.

showForm: true, //enable user to enter name and e-mail at startup 
inputFields: [ 
{ 
inputLabel: "Enter your name",
inputVariableName: "enteredFormName",
inputRequired: true,
inputPlaceholder: "Your name"
}, 
{
inputLabel: "Enter your e-mail",
inputVariableName: "enteredChatId",
inputType: "email",
inputRequired: true,
inputPlaceholder: "Your e-mail"
},
],

Below is an example code (in the script tag) where the chatter is prompted for name, email address, customer number and a subject keyword (topic), where name and customer numer are mandatory but the other fields are not.

showForm: true, //enable user to enter name, e-mail, customer number and subject at startup 
inputFields: [
{ 
inputLabel: "Enter your name", 
inputVariableName: "enteredFormName", 
inputRequired: true, 
inputPlaceholder: "Your name"
},
{ 
inputLabel: "Enter your e-mail", 
inputVariableName: "enteredChatId", 
inputType: "email", 
inputPlaceholder: "Your e-mail"
},
{ 
inputLabel: "Enter your customer number", 
inputVariableName: "customerNumber", 
inputType: "number", 
inputRequired: true, 
inputPlaceholder: "Your customer number"
},
{
inputLabel: "Subject Keyword",
inputVariableName: "subjectKeyword"
}
],

Published

17/08/2020 - 14:26

Last updated

20/08/2020 - 16:51
0
0