Thanks for the advise Jim,
It works but I'm still unable to see the alert message, I just read the post you suggested me and I found what we need:
If you want to do something more complex, you are of course allowed to do it – i.e. testing if the value looks like an email address, generate an alert/toast to notify the user,
Do you know if there's a way to use the existing alert message? or I should create another?
Thanks!
------------------------------
Aldo Castillo Aguirre
Kaplan University
------------------------------
Original Message:
Sent: 07-24-2018 13:51
From: Jim Crespino
Subject: Web chat - Make email field required
The reason that the other fields aren't getting validate is that your validation function is only linked to the email field. You will need to define a validation function for each field as covered in this article: https://developer.genesys.com/2017/11/27/genesys-widgets-customization-sidebar-and-customizable-chat-registration-form-i/
Something like this should do the trick. Please adapt each validate() function to your needs:
inputs: [
{
id: "cx_webchat_form_firstname",
name: "firstname",
maxlength: "100",
placeholder: "@i18n:webchat.ChatFormPlaceholderFirstName",
label: "@i18n:webchat.ChatFormFirstName",
type: "text",
validateWhileTyping: false, // default is false
validate: function(event, form, input, label, $, CXBus, Common) {
if(input) {
if (input.val())
return true;
else
return false;
}
return false;
}
},
{
id: "cx_webchat_form_lastname",
name: "lastname",
maxlength: "100",
placeholder: "@i18n:webchat.ChatFormPlaceholderLastName",
label: "@i18n:webchat.ChatFormLastName",
type: "text",
validateWhileTyping: false, // default is false
validate: function(event, form, input, label, $, CXBus, Common) {
if(input) {
if (input.val())
return true;
else
return false;
}
return false;
}
},
{
id: "cx_webchat_form_email",
name: "email",
maxlength: "100",
placeholder: "Made mandatory via validate",
label: "@i18n:webchat.ChatFormEmail",
type: "text",
validateWhileTyping: false, // default is false
validate: function(event, form, input, label, $, CXBus, Common) {
if(input) {
if (input.val())
return true;
else
return false;
}
return false;
}
}]
------------------------------
Jim Crespino
Genesys - Employees
------------------------------
Original Message:
Sent: 07-24-2018 12:56
From: Aldo Castillo Aguirre
Subject: Web chat - Make email field required
Hello Jim, thanks for replying to this thread,
Sure, please take a look at the JSON code snippet:

NOTE: <g class="gr_ gr_686 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del" id="686" data-gr-id="686">The ft</g>() function highlights the required fields.
The issue that I'm facing with this validation is that the pop-ups stating that the other fields are needed to start a chat session are not popping up, they will only pop up when there's something in the email field.

Am I missing a code validation or broke something?
Regards.
------------------------------
Aldo Castillo Aguirre
Kaplan University
Original Message:
Sent: 07-24-2018 10:51
From: Jim Crespino
Subject: Web chat - Make email field required
Can you explain what you mean by the other fields don't work properly when you add validation? Also, can you paste your JSON here that shows how you setup the inputs[] array?
------------------------------
Jim Crespino
Genesys - Employees