diff --git a/WebContent/html/webpages/index.html b/WebContent/html/webpages/index.html
index 5f5a100..6796a98 100644
--- a/WebContent/html/webpages/index.html
+++ b/WebContent/html/webpages/index.html
@@ -53,7 +53,7 @@
Request
Check out our selection of devices that YOU have the chance to check out!
-
+
-
-
-
-
- Device Name |
- Model |
- Hardware |
-
-
-
-
-
-
+
+
+
+
+ Device Name |
+ Model |
+ Hardware |
+
+
+
+
+
+
@@ -244,7 +247,9 @@ function returnDevice()
}
//place html in body
document.getElementById("tablebody").innerHTML = html;
- //show modal
+ //place input in form
+ $('#deviceArray').val(arrayToString(toReturn));
+ //show modal
$('#orderInfoModal').show();
}
@@ -252,7 +257,22 @@ function returnDevice()
function hidePopup(){
$('#orderInfoModal').hide();
}
+
+//Turns array to string, which can be submitted on the form when actually returning
+//The string will contain the ID's of devices to be returned, and this will be sent to the database!
+function arrayToString(array){
+ var sb = "["
+ for(var i = 0; i < array.length; i++){
+ //get the return id, go to that index in queried devices, and get that id!
+ sb+= devices[array[i]].id;
+ if(i != array.length-1)
+ sb+=","
+ }
+ sb+="]"
+ return sb;
+}
-