I use the desktopgap application for the desktop (the file is created automatically when using the mouse click file in the desktop application), using the atom editor and firebase with this project. To summarize my project, this is just some kind of survey, so the user will have to fill out some forms.
I could not get the details that were loaded in firebase. I am sure that firebase is connected correctly, since I can get data from firebase and display it on the console. But he simply could not store form data in it.
This is my html page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<script type="text/javascript" src="cordova.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<title>AMT Survey</title>
</head>
<body>
<a href="index.html"><img src="img/back.png" style="width:8%;"></a><br>
<form id="amtForm">
<b style="font-size: 27px;">AMT <p></b>
<b class=fs>Screen by: </b><br><input type="text" name="screenby" id="screenby"><br>
<b class=fs>Name of client:</b> <br><input type="text" name="client" id="client"><br>
<b class=fs>Date: </b><br><input type="date" name="date" id="date"><p>
<input type="submit" class="button" value="Submit">
</form>
<script src="https://www.gstatic.com/firebasejs/4.6.2/firebase.js"></script>
<script scr="main.js"></script>
</body>
</html>
and this is my js file
(function() {
const config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
};
firebase.initializeApp(config);
}());
var nameRef = firebase.database().reference('name');
document.getElementById('amtForm').addEventListener('submit',submitForm);
function submitForm(e){
e.preventDefault();
var name = getInputVal('name');
var client = getInputVal('client');
var date = getInputVal('date');
saveMessage(name,client,date);
}
function getInputVal(id){
return document.getElementById(id).value;
}
function saveMessage(name,client,date){
var newMessageRef = nameRef.push();
newMessageRef.set({
name:name,
client:client,
date:date
});
}
This code is from a YouTube video tutorial, and it does not seem to encounter the same error as me. Here is the video https://www.youtube.com/watch?v=PP4Tr0l08NE
- ? , , ? , , - ?
, sreenshot , - , .
, , - firebase
FYI: cornova.js script . fatel
