Created
February 19, 2018 04:52
-
-
Save shyampurk/241ae2dd9e7ab14fba5df3fd6967a3ea to your computer and use it in GitHub Desktop.
Event Customer Feedback Form Submit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pub_publish(pub_msg){ | |
pubnub.publish({ | |
channel : channel_input, | |
message : pub_msg, | |
callback : function(m){ | |
console.log(m); | |
} | |
}); | |
}; | |
function send_message(){ | |
var feedback = { | |
"userMessage":inputMessage.val() | |
} | |
// Here we store the feedback entered by the user | |
uFeedback = feedback; | |
if(inputMessage.val().length != 0){ | |
pub_publish(feedback); | |
inputMessage.val(""); | |
} | |
}; | |
inputMessageSubmit.on( "click", function() { | |
send_message(); | |
document.getElementById('uMessage').innerHTML = uFeedback.userMessage; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment