Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 2.46 KB

README.md

File metadata and controls

90 lines (70 loc) · 2.46 KB

Stunning-disco

download download download

Prequisite

In a nutshell

images

and

all-might-youre-next

Introduction

  • Interfacing form data by storing it in JSON format in LiveDataBase [NoSQL Database DOM oriented]//Firebase
  • [For Reference] (https://youtu.be/zx2YoBMfflM)
  • Static page can be rendered as per the person whose going to implement this

Database bridge

Basic Snippet for

Collecting Form Data

// Your web app's Firebase configuration
const mainConfig = {
  apiKey: "",
  authDomain: "",
  databaseURL: "",
  projectId: "",
  storageBucket: "",
  messagingSenderId: "",
  appId: ""
};

// Initialize Firebase
firebase.initializeApp(mainConfig);

// Refernece contactInfo collections
let contactInfo = firebase.database().ref("Inventrix_Regs");

// Listen for a submit
document.querySelector(".contact-form").addEventListener("submit", submitForm);

function submitForm(e) {
  e.preventDefault();

  //   Get input Values
  let name = document.getElementById(" ").value;
  let email = 
  let message = 
  let roll = 
  let phone = 
  var rate;
 //all your validation code
  }
  else{
  saveContactInfo(name, email, message,roll,phone,rate);
  //err code
  document.querySelector(".contact-form").reset();
  }
}

// Save infos to Firebase
function saveContactInfo(name, email, message,roll,phone,rate) {
  let newContactInfo = contactInfo.push();
  newContactInfo.set({
    department: roll,
    name: name,
    email: email,
    message: message,
    phone: phone,
    exited: rate,
  });

}

Overview

sys_flow