Skip to content

Commit

Permalink
Shoopingcart order popup-location name field hidden instead of disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
arc12012 committed Apr 5, 2017
1 parent a588daa commit 1843b38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions WebContent/html/webpages/shoppingCart.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ if(c.getName().equals("ssoNum")) sso = Integer.parseInt(c.getValue());
<select class="form-control" name="location_dropdown" id="dropdown" onchange="forceUpdateLocationMetadata()" style="width:65%; max-height: 80%; text-align: center; vertical-align: center; align-items: center; display: block; position: relative; margin: 0% auto; text-align-last:center; padding:">
</select>
</div>
<div class="form-group-row">
<div class="form-group-row" style = "display:'none'" name="locnamediv">
<label for="">Location Name</label>
<input type="text" onkeyup="forceDropdownCustomLocation" class="form-control" name="locname" style="width: 50%" placeholder="Give your new location a name!" readonly required/>
<input type="text" onkeyup="forceDropdownCustomLocation" class="form-control" name="locname" style="width: 50%" placeholder="Give your new location a name!" required/>
</div>
<div class="form-group row" style="display: block; align-items: center;margin: 3% auto;">
<div class="col-md-6" style="width:50%">
Expand Down Expand Up @@ -398,17 +398,17 @@ function forceUpdateLocationMetadata() {
document.orderForm.state.value = selectedLocation.state;
document.orderForm.zip.value = selectedLocation.zip;
// if we're force updating metadata, it means we don't want the name to be editable
document.orderForm.locname.readOnly=true;
document.getElementsByName("locnamediv")[0].style.display="none";
}
else document.orderForm.locname.readOnly=false; //Should be editable with new location though
else document.getElementsByName("locnamediv")[0].style.display="initial"; //Should be editable with new location though
}
function forceDropdownCustomLocation() {
document.orderForm.location_dropdown.selectedIndex=0;
document.orderForm.locname.value="";
document.orderForm.locname.readOnly=false; //let user edit name since they're making new location
document.getElementsByName("locnamediv")[0].style.display="initial"; //let user edit name since they're making new location
}
function getLocations() {
Expand Down

0 comments on commit 1843b38

Please sign in to comment.