Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
I'm using firebase realtime database to store data from my html page after clicking on insert button, but it's not adding data in database
    <!DOCTYPE html>
<html>
    <head>
        <title>FIREBASE/DATABASE</title>
    </head>
    <body>
        RollNo <input id="rollbox" type="text"></input><br><br>
        Name <input id="namebox" type="text"></input><br><br>
        Gender <input id="genbox" type="text"></input><br><br>

        <button id="insert">INSERT</button>
        <button id="select">SELECT</button>
        <button id="delete">DELETE</button>


       <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-app.js"></script>
       <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-auth.js"></script>
       <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-database.js"></script>

       <script id="MainScript">
           const firebaseConfig = {
                apiKey: "AIzaSyD0h3tnkshN4rjSA9Iju08ntGJ72SM2LlY",
                authDomain: "fir-3d4fe.firebaseapp.com",
                projectId: "fir-3d4fe",
                storageBucket: "fir-3d4fe.appspot.com",
                messagingSenderId: "1055090212601",
                appId: "1:1055090212601:web:26a02d69edade66cf0ac28"
            };
            var name,roll,gender;
            function Ready(){
                name=document.getElementById("rollbox").value;
                roll=document.getElementById("namebox").value;
                gender=document.getElementById("genbox").value;
            }
            document.getElementById("insert").onclick=function(){
                Ready();
                firebase.database().ref('student/'+rollv).set({
                    nameOfStudent:name,
                    rollNo:roll,
                    genderOfStudent:gender
                })
            }
       </script> 
    </body>
</html>

Above is code for my html page for adding data to firebase realtime database. But it is not adding data after clicking insert button. Please help me with my code. I want my code to only add data of input fields to firebase realtime database, please check the code.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Hey you haven't define from where rollv is coming this is undefine that whill give undefine in path of ref

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda