Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!