-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
85 lines (61 loc) · 2.52 KB
/
script.js
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// import * as functions from "firebase-functions";
// export const helloWorld = functions.https.onRequest((request, response) => {
// response.send("Hello from Firebase!");
// });
// If you want the dropdown to disappear when you move the mouse away
var dropdowns = document.querySelectorAll('.dropdown');
dropdowns.forEach(function(dropdown) {
dropdown.addEventListener('mouseleave', function() {
dropdown.querySelector('.dropdown-menu').style.display = 'none';
});
});
const button1 = document.getElementById("bt1");
const button2 = document.getElementById("bt2");
const Aptform = document.getElementById("form1");
// Add an event listener to the button
button1.addEventListener('click', function() {
// Display the form
Aptform.style.display = 'block';
});
button2.addEventListener('click', function() {
// Display the form
Aptform.style.display = 'block';
});
const firebaseConfig = {
apiKey: "AIzaSyDjPuTIJH8ZaCT3G6xkXSvAX9XsaxWdL_8",
authDomain: "healthcare-e994c.firebaseapp.com",
databaseURL: "https://healthcare-e994c-default-rtdb.asia-southeast1.firebasedatabase.app",
projectId: "healthcare-e994c",
storageBucket: "healthcare-e994c.appspot.com",
messagingSenderId: "786358937864",
appId: "1:786358937864:web:5df9a3123a71a5c832e4bd",
measurementId: "G-XMCYW9JFF0"
};
firebase.initializeApp(firebaseConfig);
var healthcareDB= firebase.database().ref("healthcare");
document.getElementsByClassName("form1").addEventListener("submit",submitForm);
// var database = firebase.database();
// var formRef = database.ref('form-data');
function submitForm(e){
e.preventDefault();
var name=document.getElementById("name").value;
var age=document.getElementById("age").value;
var gender=document.getElementById("gender").value;
var number=document.getElementById("number").value;
var address=document.getElementById("address").value;
var reason=document.getElementById("reason").value;
console.log(name,age,gender,number,address,reason);
}
const getElementVal=(id)=>{
return document,getElementById(id).value;
// var formData={
// name:name,age:age,gender:gender,number:number,address:address,reason:reason
};
// formRef.push(formData);
// document.getElementById("form1").reset();
// alert("Your Appointment Booked!");
// var database= firebase.database();
// var myRef = database.ref("C:\Users\aksha\OneDrive\Desktop\Web\web practice\web project");
// myRef.set("Hello");
// var submitBtm=document.getElementById("submit-btn");
// submitBtm.addEventListener("click",submitForm);