diff --git a/WebContent/html/javascript/request.jsp b/WebContent/html/javascript/request.jsp
index 6e050fe..9e2e523 100644
--- a/WebContent/html/javascript/request.jsp
+++ b/WebContent/html/javascript/request.jsp
@@ -31,6 +31,8 @@ for(var a = 0; a < softwareOptions.length; a++){
// searchbar listener
var searchbar = document.getElementsByName('searchBar');
searchbar[0].onkeyup = refresh;
+// populate page with all devices by default
+show(devices);
function refresh() {
show(fuzzyFilter(filter(devices)));
}
diff --git a/WebContent/html/webpages/shoppingCart.jsp b/WebContent/html/webpages/shoppingCart.jsp
index 35a396d..8b5a3e3 100644
--- a/WebContent/html/webpages/shoppingCart.jsp
+++ b/WebContent/html/webpages/shoppingCart.jsp
@@ -177,7 +177,7 @@ pageEncoding="ISO-8859-1"%>
-
+
@@ -185,7 +185,7 @@ pageEncoding="ISO-8859-1"%>
-
+
@@ -239,6 +239,7 @@ var orderForm = document.getElementById('orderInfoModal');
var orderFormCloseButton = document.getElementById('closeOrderForm');
orderFormCloseButton.addEventListener('click',hidePopup);
// done applying event listeners
+document.getElementById('datePicker').valueAsDate = new Date();
var employee = {
id:"",
@@ -336,15 +337,23 @@ function changeStatus(){
// These functions just redirect button pressed to call the showPopup method with the appropriate parameter
function orderSelected_showPopup() {
- showPopup("false");
+ showPopup(false);
}
function orderAll_showPopup() {
- showPopup("true");
+ showPopup(true);
}
// Opens order form and calls autofill method. Parameter is actually a string, not a boolean, because it will be put into a text field.
// It indicaties which button was used to call the method.
// If true, submitting the form will order everything in the cart. If false it only orders selected devices.
function showPopup(orderAllBool){
+ if(checked.length==0 && !orderAllBool){
+ $('#Submit').attr('disabled',true);
+ $('#Submit').attr('title',"There aren't any devices selected to order!");
+ }
+ else{
+ $('#Submit').attr('disabled',false);
+ $('#Submit').removeAttr('title');
+ }
orderForm.style.display = "block";
autoFillFields(orderAllBool);
}
@@ -385,7 +394,7 @@ function autoFillFields(orderAllBool) {
// and fill in the location sub-fieds
forceUpdateLocationMetadata();
// finally mark hidden orderAll field appropriately
- document.orderForm.orderAll.value=orderAllBool;
+ document.orderForm.orderAll.value=orderAllBool?"true":"false";
// Also, this is where I'm going to restrict the date input to the future
var dtToday = new Date();