diff --git a/static/add.js b/static/add.js new file mode 100644 index 0000000..16dad60 --- /dev/null +++ b/static/add.js @@ -0,0 +1,35 @@ +function add_asset() { + let serial = document.getElementById("add-asset-serial"); + let tag = document.getElementById("add-asset-tag"); + let category = document.getElementById("add-asset-category"); + let model = document.getElementById("add-asset-model"); + + if (tag.value == "") { + tag = null; + } else { + tag = tag.value; + document.getElementById("add-asset-tag").value = ""; + } + if (serial.value == "") { + alert('Serial field cannot be empty!') + return; + } else { + serial = serial.value; + document.getElementById("add-asset-serial").value = ""; + } + if (category.value == "N/A") { + category = null; + } else { + category = category.value; + document.getElementById("add-asset-category").value = "N/A"; + } + if (model.value == "N/A") { + model = null; + } else { + model = model.value; + document.getElementById("add-asset-model").value = "N/A"; + } + + console.log(serial,tag,category,model); + +} \ No newline at end of file diff --git a/templates/add.js b/templates/add.js deleted file mode 100644 index e24b816..0000000 --- a/templates/add.js +++ /dev/null @@ -1,3 +0,0 @@ -function update_add_asset_model() { - -} \ No newline at end of file diff --git a/templates/adding.html b/templates/adding.html index 5ef137d..32f9a0e 100644 --- a/templates/adding.html +++ b/templates/adding.html @@ -21,50 +21,184 @@
+The asset tag is a pseudo-optional field and will assign based on the + database and auto increment the database counter if not provided.
+ +The serial is required for an asset.
+ +Both the model and category are optional fields.
+Provide the asset tag to modify the serial, model, and category.
+ +The serial should only be modified to correct erroneous data.
+The user name field is required as that is how we identify users.
+The user ID field is optional and an ID will automatically be + assigned if an ID is not provided. +
+The assigned card and assigned asset fields are optional.
+Provide the user id of the user you want to modify.
+Typically used to assign cards and assets as needed.
+