Commit 1a5fa28c authored by unknown's avatar unknown

connect chatbot to the backend

parent 05f004ef
...@@ -1427,10 +1427,10 @@ function myMap() { ...@@ -1427,10 +1427,10 @@ function myMap() {
</div> </div>
<div class="panel-footer" id="inputSec"> <div class="panel-footer" id="inputSec">
<div class="input-group"> <div class="input-group">
<input id="btn-input" type="text" class="form-control input-sm chat_input" placeholder="Write your message here..." required="required" /> <input id="msg_value" autocomplete="off" type="text" class="form-control input-sm chat_input" placeholder="Write your message here..." required="required" />
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-primary btn-sm" style="margin-top: 5%;" id="btn-chat">Send <i class="fa fa-send-o" style="font-size:15px; padding-left: 5%;"></i></button> <button class="btn btn-primary btn-sm" style="margin-top: 5%;" id="btn-chat" onclick ="MsgSend()">Send <i class="fa fa-send-o" style="font-size:15px; padding-left: 5%;"></i></button>
</span> </span>
</div> </div>
</div> </div>
...@@ -1465,6 +1465,28 @@ function myMap() { ...@@ -1465,6 +1465,28 @@ function myMap() {
document.getElementById('messagebody').style.display = 'none'; document.getElementById('messagebody').style.display = 'none';
document.getElementById('inputSec').style.display = 'none'; document.getElementById('inputSec').style.display = 'none';
} }
function MsgSend()
{
var msg = document.getElementById("msg_value").value;
var req = getXmlHttpRequestObject();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {
alert(req.responseText);
// alert('Line no : '+lineno);
}
}
}
req.open("GET", 'chat.php?&msg='+msg, true);
req.send();
}
}
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment