var loginDB = firebase.database().ref("login-demi"); document.getElementById("login").addEventListener('submit', perform); function perform(e) { e.preventDefault(); var vname = document.getElementById("namNew").value; var vpassword = document.getElementById("pswd").value; loginDB.orderByChild("name" + "password").on("child_added", function (data) { var nam = data.val().name; var pss = data.val().password; if (nam == vname && pss == vpassword) { console.log(pss); } else { console.log(vname); } }); }
<div class="alert">Logging In!</div> <div class="alert1">Try Again</div> <div class="InputBox"> <input type="text" id="namNew" placeholder="Name"> </div> <div class="InputBox"> <input type="password" id="pswd" placeholder="Password"> </div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)