diff --git a/WebContent/html/javascript/request.jsp b/WebContent/html/javascript/request.jsp index 640eb5e..daffd7d 100644 --- a/WebContent/html/javascript/request.jsp +++ b/WebContent/html/javascript/request.jsp @@ -32,6 +32,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 2e2a398..bc0d203 100644 --- a/WebContent/html/webpages/shoppingCart.jsp +++ b/WebContent/html/webpages/shoppingCart.jsp @@ -166,7 +166,7 @@ pageEncoding="ISO-8859-1"%>

- +
@@ -174,7 +174,7 @@ pageEncoding="ISO-8859-1"%>
- + @@ -228,6 +228,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:"", @@ -325,15 +326,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); } @@ -374,7 +383,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();