From a1f753d63d96e4010d8bcb5effb43dd5a0441f51 Mon Sep 17 00:00:00 2001 From: jschnapper Date: Mon, 9 Dec 2019 01:59:50 -0500 Subject: [PATCH] Delete items with apostrophes in name --- public/scripts/vol-inventory.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/scripts/vol-inventory.js b/public/scripts/vol-inventory.js index 2ce3482..8dc457e 100644 --- a/public/scripts/vol-inventory.js +++ b/public/scripts/vol-inventory.js @@ -18,7 +18,7 @@ $(document).ready(function() { ${currentItem.itemName} ${currentItem.count} - + `) } // append to dom @@ -58,7 +58,7 @@ $(document).ready(function() { ${currentItem.itemName} ${currentItem.count} - + `) } @@ -123,6 +123,10 @@ function standardizeName(itemName) { return newName; } +function formatNameForHTML(itemName) { + return itemName.replace(/'/g, "\\'") +} + function setOutOfStock(itemName, barcode) { if (confirm("Set " + itemName + " to Out of Stock?")) { return firebase.database().ref('/barcodes/').once('value').then(function(barcodesTable) {