" /> webchat registration form - Genesys CTI User Forum

Author Topic: webchat registration form  (Read 1561 times)

Offline ekobyakov

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
webchat registration form
« on: January 07, 2018, 09:47:52 PM »
Advertisement
Hi guys,

I'm trying to use custom form for webchat. But no luck.

I'm using the following code:
[code]window._genesys.widgets = {
            main: {
                debug: true,
                theme: "dark",
                lang: "en",
                mobileMode: 'auto',
                mobileModeBreakpoint: 767,
                downloadGoogleFont: 'false'

            },
            webchat: {
                dataURL: "url_here",
                apikey: "",
                userData: {},
                emojis: false,
                uploadsEnabled: false,
                autoInvite: {
                    enabled: false,
                    timeToInviteSeconds: 5,
                    inviteTimeoutSeconds: 30
                },
                chatButton: {
                    enabled: true,
                    openDelay: 1000,
                    effectDuration: 300,
                    hideDuringInvite: true,
                    template: '<div>LIVE CHAT</div>'
                },
                form: {
                    formJSON: {
                        wrapper: "<table></table>",
                        inputs: [{
                                id: "cx_webchat_form_firstname",
                                name: "firstname",
                                maxlength: "100",
                                placeholder: "My placeholder",
                                label: "my label",
                                validateWhileTyping: true, // default is false
                            },

                            {
                                id: "cx_webchat_form_lastname",
                                name: "lastname",
                                maxlength: "100",
                                placeholder: "@i18n:webchat.ChatFormPlaceholderLastName",
                                label: "@i18n:webchat.ChatFormLastName"
                            },

                            {
                                id: "cx_webchat_form_email",
                                name: "email",
                                maxlength: "100",
                                placeholder: "@i18n:webchat.ChatFormPlaceholderEmail",
                                label: "@i18n:webchat.ChatFormEmail",
                                validateWhileTyping: true, // default is false
                            },

                            {
                                id: "cx_webchat_form_subject",
                                name: "subject",
                                maxlength: "100",
                                placeholder: "@i18n:webchat.ChatFormPlaceholderSubject",
                                label: "@i18n:webchat.ChatFormSubject"
                            }
                        ]
                    }
                }

            }
        };[/code]

any help or working example is much appreciated.

Thanks.

Offline jamesmurphyau

  • Full Member
  • ***
  • Posts: 123
  • Karma: 2
Re: webchat registration form
« Reply #1 on: January 08, 2018, 07:18:29 AM »
Should be:

form: {
  wrapper: "<table></table>",
  inputs: [{ ...}]
}

Not

form: {
  formJSON: {
    wrapper: "<table></table>",
    inputs: [{ .. }]
  }
}