I'm doing fine with this code but would like to have a submit button that will help me submit a form in addition to it. From this, I also want to get the value of input text through request.vars in controller.
this.typeInput = function(callbackFn) {
var inputWrap = document.createElement("div")
inputWrap.className = "input-wrap"
var inputText = document.createElement("textarea")
inputText.setAttribute("placeholder", "Ask me anything...")
inputWrap.appendChild(inputText)
inputText.addEventListener("keypress", function(e) {
// register user input
if (e.keyCode == 13) {
e.preventDefault()
typeof bubbleQueue !== false ? clearTimeout(bubbleQueue) : false // allow user to interrupt the bot
When I try to add a function as inputText.setAttribute('type','submit') i get a blank screen.
Am I missing something
javascriptline of code with a semi-colon;