-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.js
More file actions
executable file
·61 lines (53 loc) · 1.76 KB
/
Copy pathjavascript.js
File metadata and controls
executable file
·61 lines (53 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
////Ajax Call for the patient login form
////Once the form is submitted
//$("#patientloginform").submit(function(event){
// //prevent default php processing
// event.preventDefault();
// //collect user inputs
// var datatopost = $(this).serializeArray();
//// console.log(datatopost);
// //send them to login.php using AJAX
// $.ajax({
// url: "loginpat.php",
// type: "POST",
// data: datatopost,
// success: function(data){
// if(data === "success"){
// window.location = "patientlogin.php";
// }else{
// $('#patientmessage').html(data);
// }
// },
// error: function(){
// $("#patientmessage").html("<div class='alert alert-danger'>There was an error with the Ajax Call. Please try again later.</div>");
//
// }
//
// });
//
//});
//Ajax Call for the doctor login form
//Once the form is submitted
$("#doctorloginform").submit(function(event){
//prevent default php processing
event.preventDefault();
//collect user inputs
var datatopost = $(this).serializeArray();
// console.log(datatopost);
//send them to login.php using AJAX
$.ajax({
url: "logindoc.php",
type: "POST",
data: datatopost,
success: function(data){
if (data == "success"){
window.location = "doctorlogin.php" ;
}else{
$("#doctormessage").html(data) ;
}
},
error: function(){
$("#doctormessage").html("<div class='alert alert-danger'>There was an error with the Ajax Call. Please try again later.</div>");
}
});
});