Commit 706f4976 authored by Mihiranga G.L.V - IT18500790's avatar Mihiranga G.L.V - IT18500790

Merge branch 'IT18085822' into 'master'

connect chatbot to the backend

See merge request !24
parents 05f004ef 1a5fa28c
...@@ -1428,9 +1428,9 @@ function myMap() { ...@@ -1428,9 +1428,9 @@ function myMap() {
<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