-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.js
33 lines (22 loc) · 1.14 KB
/
home.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$(function() {
$("input").change(function() {updateOrderTotal();});
$("#orderForm").submit(function( event ) {
$("input[name='PlaceOrder']").attr("disabled",true);
if ($("input[name='SalesPerson']").val() == "") {
$("input[name='SalesPerson']").val("Olympia Robotics Federation");
}
$("#result").text("Submitting order...");
});
});
function updateOrderTotal() {
var SixRed = Number($("input[name='SixRed']").val());
var SixWhite = Number($("input[name='SixWhite']").val());
var SixPink = Number($("input[name='SixPink']").val());
var EightPointFiveRed = Number($("input[name='EightPointFiveRed']").val());
var EightPointFiveWhite = Number($("input[name='EightPointFiveWhite']").val());
var EightPointFivePink = Number($("input[name='EightPointFivePink']").val());
var TenRed = Number($("input[name='TenRed']").val());
var TenWhite = Number($("input[name='TenWhite']").val());
var TenPink = Number($("input[name='TenPink']").val());
$("#OrderTotal").text("Current Total: $" + (12*(SixPink+SixRed+SixWhite) + 24*(EightPointFivePink+EightPointFiveRed+EightPointFiveWhite) + 36*(TenPink+TenRed+TenWhite)));
}