Check Radio buttons (stumped)

Check Radio buttons (stumped)


I’m practicing with firebase. The issue I having is with the radio buttons. You click on one radio to update a field. Once you click on UPDATE, nothing happens. tabel looks like this

-itemID: “001”
-itemTItle: “Somthin”
-itemQTY: “4”
-itemPrice: “3.50”

!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" media="all" href="style.css">

    <!-- update the version number as needed -->
    <script defer src="/__/firebase/5.0.4/firebase-app.js"></script>
    <!-- include only the Firebase features as you need -->
    <script defer src="/__/firebase/5.0.4/firebase-auth.js"></script>
    <script defer src="/__/firebase/5.0.4/firebase-database.js"></script>
    <script defer src="/__/firebase/5.0.4/firebase-messaging.js"></script>
    <script defer src="/__/firebase/5.0.4/firebase-storage.js"></script>
    <!-- initialize the SDK after all desired features are loaded -->
    <script defer src="/__/firebase/init.js"></script>

    <div class="navHeader">
    	<h1>Inventory App</h1>
    		<li><a href="index.html">Overview</a></li>
    		<li><a href="Adjust.html">Adjust</a></li>
    		<li><a href="History.html">History</a></li>
    <div class="add2DB">
    	<textarea id="getID" placeholder="Enter Product's barcode"></textarea>
    	<textarea id="getTitle" placeholder="Enter Product's Name"></textarea>
    	<textarea id="getQTY" placeholder="Enter Quantity of Product"></textarea>
    	<textarea id="getPrice" placeholder="Enter Product's Price Per Unit"></textarea>
    	<button id="submit" onclick="getInfo()">ADD!</button>
    	<textarea id="udID" placeholder="Barcode"></textarea>
    	<textarea id="udInfo" placeholder="Update"></textarea>
    	<label id="code">Code<input type="radio"></label>
    	<label id="name">Name<input type="radio"></label>
    	<label id="qty">QTY<input type="radio"></label>
    	<label id="price">Price<input type="radio"></label>
    	<button id="radioButton" onclick="update()">UPDATE!</button>
    <script type="text/javascript">
	  var submitInfo = document.getElementById("submit");
	  var upDateInfo = document.getElementById("radioButton");
		function getInfo()
			var textID = document.getElementById("getID").value;
			var textTitle = document.getElementById("getTitle").value;
			var textQTY = document.getElementById("getQTY").value;
			var textPrice = document.getElementById("getPrice").value;
			var firebaseRef = firebase.database().ref("Item/");
				itemID: textID,
				itemTitle: textTitle,
				itemQTY: textQTY,
				itemPrice: textPrice
			document.getElementById("getID").value = " ";
			document.getElementById("getTitle").value = " ";
			document.getElementById("getQTY").value = " ";
			document.getElementById("getPrice").value = " ";
		function update()
			var radioID = document.getElementById("udID").value;
			var radioInfo = document.getElementById("udInfo").value;
			var radioRef = firebase.database().ref("Item/");
					itemID: radioInfo
			else if(document.getElementById("name").checked){
					itemTitle: radioInfo
			else if(document.getElementById("qty").checked){
					itemQTY: radioInfo
			else if(document.getElementById("price").checked){
					itemPrice: radioInfo


When you say nothing happens, does the event get fired? Does the variable get set? Did you turn it off and on again?


sometimes you need to walk away and realize what you’re doing wrong. The id’s are inside the label tag and not in the input tag.