Skip to content

Commit

Permalink
Added calendar selector-that was easier than I thought.
Browse files Browse the repository at this point in the history
Needs some css love, and a way to include data from the new fields when generating tickets.
  • Loading branch information
arc12012 committed Mar 17, 2017
1 parent 8b3cc0b commit 58f881b
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions WebContent/html/webpages/shoppingCart.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ pageEncoding="ISO-8859-1"%>
<input type="text" name="userID" style = "display: none;"/>
<input type="text" name="orderAll" style = "display: none;"/>
<input type="text" name="deviceIDs" style="display: none;">
<div class="form-group">
<div class="form-group row">
<label for="name">Your name</label><br/>
<input type="text" class="form-control" name="name" placeholder="Name" />
</div>
<div class="form-group">
<div class="form-group row">
<label for="phone">Phone Number</label><br/>
<input type="text" class="form-control" name="phone" placeholder="203-867-5309">
</div>
Expand All @@ -82,27 +82,27 @@ pageEncoding="ISO-8859-1"%>
<div class="col-md-6" style="width:50%">
<div class="form-group row">
<label for="address">Street Address</label>
<input type="text" class="form-control" name="address" placeholder="Address"/>
<input type="text" onkeyup="forceDropdownCustomLocation" class="form-control" name="address" placeholder="Address"/>
</div>
<div class="form-group row">
<label for="city">City</label>
<input type="text" class="form-control" name="city" placeholder="City"/>
<input type="text" onkeyup="forceDropdownCustomLocation" class="form-control" name="city" placeholder="City"/>
</div>
</div>
<div class="col-md-6" style="width:50%">
<div class="form-group row">
<label for="state">State</label>
<input type="text" class="form-control" name="state" placeholder="State"/>
<input type="text" onkeyup="forceDropdownCustomLocation" class="form-control" name="state" placeholder="State"/>
</div>
<div class="form-group row">
<label for="zip">Zip</label>
<input type="text" class="form-control" name="zip" placeholder="Zip Code"/>
<input type="text" onkeyup="forceDropdownCustomLocation" class="form-control" name="zip" placeholder="Zip Code"/>
</div>
</div>
</div>
<div class="form-group row">
<label for="timeNeeded">How many weeks do you think you'll need it?</label><br/>
<input type="text" class="form-control" name="timeNeeded" placeholder="Just estimate the number of weeks" />
<label for="timeNeeded">How long you think you'll need it?</label><br/>
<input type="date" class="form-control" name="timeNeeded" style="40%" />
</div>
<button type="submit" class="btn btn-primary" name="Submit">Submit</button>
</form>
Expand Down Expand Up @@ -137,10 +137,11 @@ document.getElementById('ds').addEventListener('click',deleteSelected);
document.getElementById('oa').addEventListener('click',orderAll_showPopup);
document.getElementById('da').addEventListener('click',deleteAll);
document.orderForm.address.addEventListener('onkeyup',forceDropdownCustomLocation);
document.orderForm.city.addEventListener('onkeyup',forceDropdownCustomLocation);
document.orderForm.state.addEventListener('onkeyup',forceDropdownCustomLocation);
document.orderForm.zip.addEventListener('onkeyup',forceDropdownCustomLocation);
// Event listeners for order form address fields, to force select New Location if a field is changed
document.orderForm.address.addEventListener('keyup',forceDropdownCustomLocation);
document.orderForm.city.addEventListener('keyup',forceDropdownCustomLocation);
document.orderForm.state.addEventListener('keyup',forceDropdownCustomLocation);
document.orderForm.zip.addEventListener('keyup',forceDropdownCustomLocation);
document.onkeydown = function(e) {
if (e.keyCode == 27) {
Expand Down Expand Up @@ -291,7 +292,7 @@ function autoFillFields(orderAllBool) {
document.orderForm.name.value=employee.name;
document.orderForm.phone.value=employee.phone;
// already got locations on page load, now populate dropdown and mark appropriate option selected
document.orderForm.location_dropdown.innerHTML="<option id = -1>New Location...</option>";
document.orderForm.location_dropdown.innerHTML="<option id = 0>New Location...</option>";
for (var i = locations.length - 1; i >= 0; i--) {
document.orderForm.location_dropdown.innerHTML+=
("<option id = "+locations[i].id
Expand Down Expand Up @@ -322,7 +323,7 @@ function forceUpdateLocationMetadata() {
}
function forceDropdownCustomLocation() {
$("#dropdown").val('0');
$("#dropdown option[id='0']").attr("selected",true);
}
function getLocations() {
Expand Down

0 comments on commit 58f881b

Please sign in to comment.