Public API
When instantiating ConversationalForm a reference to the instance will be available in window scope.
window.ConversationalForm
Be aware that if you create mutiple Conversational Forms within one page then the reference will be overwritten with latest created. Use windo.ConversationalForm[form["cf-create-id"]]?` or just manually instantiate the form and user the returned instance.
Method | Description | Code |
---|---|---|
addTags | Add tags to the form, see examples/formless.html for how this can be achived. |
|
focus | Sets focus on Conversational Form. |
|
addRobotChatResponse | add a robot reponse, this you would usually do at the end of a process. |
|
addUserChatResponse | add a user reponse. The opposite of the above. |
|
remove | remove the ConversationalForm by calling: |
|
getFormData | get the FormData object of mapped form element, pass in true to get a serialized object back (JSON). |
|
remapTagsAndStartFrom | remap registered tags and start flow from {index} possible to ignore existing tags, to allow for the flow to just "happen". |
|