Hello. I would like to ask you a question. I want to create a custom registration form that will ask the user to fill in the email, first name and last name. I also want to have two questions. The possible answers of each of the questions are "yes" and "no". When the user opens the form, I would like only the first question to be visible and after the user selects the "yes" option, then the second question will appear. You can see my implementation below
form: {
wrapper: '<table></table>',
inputs: [
{
id: 'cx_webchat_form_firstname',
name: 'firstname',
maxlength: '100',
label: '@i18n:webchat.ChatFormFirstName',
},
{
id: 'cx_webchat_form_lastname',
name: 'lastname',
maxlength: '100',
label: '@i18n:webchat.ChatFormLastName',
},
{
id: 'cx_webchat_form_email',
name: 'email',
maxlength: '100',
label: '@i18n:webchat.ChatFormEmail',
},
{
id: 'cx_webchat_form_field_1',
name: 'customField1',
type: 'select',
label: 'Question1',
options: [
{
text: 'Yes',
value: 'Yes',
selected: true,
},
{
text: 'No',
value: 'No',
},
],
},
{
id: 'cx_webchat_form_field_2',
name: 'customField2',
type: 'select',
label: 'Question2',
options: [
{
text: 'Yes',
value: 'Yes',
selected: true,
},
{
text: 'No',
value: 'No',
},
],
},
],
}
Can I somehow show/hide the second question based on the answer of the first question?
Thanks in advance