-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwishform.js
More file actions
28 lines (25 loc) · 806 Bytes
/
Copy pathwishform.js
File metadata and controls
28 lines (25 loc) · 806 Bytes
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
const firebaseApp = firebase.initializeApp(firebaseConfig);
const db = firebaseApp.firestore();
const auth = firebaseApp.auth();
function savedata(){
const email = document.getElementById("email").value
const namebook = document.getElementById("namebook").value
const author = document.getElementById("nameauthor").value
const domain = document.getElementById("domain").value
const isbn = document.getElementById("isbn").value
db.collection('requestedbooks')
.add({
email: email,
namebook:namebook,
author: author,
domain: domain,
isbn: isbn
})
.then((docRef)=>{
console.log("Document written with ID: ", docRef.id)
alert("Request submitted")
})
.catch((error)=>{
console.log(error)
});
}