MetroWorks Education-Order Form-08-10-2016_v01

Validate that a minimum of ten passes is required for a discount to fire.

by freedawirl

HTML

<script src="//limonte.github.io/sweetalert2/dist/sweetalert2.min.js"></script>
<link rel="stylesheet" href="//limonte.github.io/sweetalert2/dist/sweetalert2.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Begin Form 2 --><div class="container" id="form"><div class="z15_header"><h1 class="content-title">Higher Education Customer Sales Order</h1>
<a class="back-link" href="/metroworks.aspx?id=3795" title="Back to MertoWorks Higher Education">‹ ‹ Go Back</a>


 &#160;</div>
<div class="n15_row"><!-- Order number wrap --><div class="z15_order_input_wrap n15_gray">
   Account<span>Number </span><input type="text" name="account_number" ektdesignns_nodetype="element" id="account_number" ektdesignns_caption="Account Number:" ektdesignns_name="account_number" title="  A valid customer ID is required" class="n15_order_id design_textfield" placeholder="Enter Order #" ektdesignns_validation="string-req" ektdesignns_datatype="string" ektdesignns_basetype="text" ektdesignns_schema="&lt;xs:minLength value=&quot;1&quot;/&gt;" ektdesignns_validate="re:/\S+/" ektdesignns_invalidmsg="A valid customer ID is required" onblur="design_validate_re(/\S+/,this,'A valid customer ID is required');" size="34" />

  &#160;</div>
<div class="n15_customer_info_wrap"><div id="CustomerInfo"><h4>CUSTOMER</h4>
<ul>
<li><span class="railred">*</span><input type="text" name="contact_name" ektdesignns_nodetype="element" id="contact_name" ektdesignns_caption="Contact Name:" ektdesignns_name="contact_name" title="Contact Name  (Required) &#xA;Cannot be blank" class="design_textfield" placeholder="Contact Name" ektdesignns_validation="string-req" ektdesignns_datatype="string" ektdesignns_basetype="text" ektdesignns_schema="&lt;xs:minLength value=&quot;1&quot;/&gt;" ektdesignns_validate="re:/\S+/" ektdesignns_invalidmsg="Cannot be blank"...

JavaScript

// Variables for the Higher-Ed form

var n15_qty_1e = $('.n15_qty_1e').val();
var n15_qty_2e = $('.n15_qty_2e').val();
var n15_qty_3e = $('.n15_qty_3e').val();
var n15_qty_4e = $('.n15_qty_4e').val();

var n15_p_1e_single_price
var n15_p_2e_single_price
var n15_p_3e_single_price
var n15_p_4e_single_price

//var n15_total_price_1e = $('.n15_total_price_1b').val();
//var n15_total_price_2e = $('.n15_total_price_2b').val();
//var n15_total_price_3e = $('.n15_total_price_3b').val();
//var n15_total_price_4e = $('.n15_total_price_4b').val();

var n15_total_price_1e = $('.n15_total_price_1e').val();
var n15_total_price_2e = $('.n15_total_price_2e').val();
var n15_total_price_3e = $('.n15_total_price_3e').val();
var n15_total_price_4e = $('.n15_total_price_4e').val();


n15_total_price_1e = n15_total_price_1e.replace("$", "");
n15_total_price_2e = n15_total_price_2e.replace("$", "");
n15_total_price_3e = n15_total_price_3e.replace("$", "");
n15_total_price_4e = n15_total_price_4e.replace("$", "");

var n15_total_price_e
var n15_qty_total_e
var n15_subtotal_price_e
var n15_final_price_e

// Variables for both forms

var n15_processing = 12.00;



// Second form Jquery

$('.n15_qty_1e, .n15_qty_2e, .n15_qty_3e, .n15_qty_4e, .n15_single_price_4e').on('change keyup', function () {

	n15_qty_1e = $('.n15_qty_1e').val();

    // Setting Price

    n15_p_1e_single_price = 27.00;

    $('.n15_single_price_1e').val('$' + n15_p_1e_single_price.toFixed(2));

    n15_total_price_1e = n15_qty_1e * n15_p_1e_single_price;

    ($(this).closest("tr").find('.n15_total_price_1e').val('$' + n15_total_price_1e.toFixed(2)));

    // Jquery for Form 2 second table row

    n15_qty_2e = $('.n15_qty_2e').val();

    // Setting Price

    n15_p_2e_single_price = 40.00;

    $('.n15_single_price_2e').val('$' + n15_p_2e_single_price.toFixed(2));

    n15_total_price_2e = n15_qty_2e * n15_p_2e_single_price;

    ($(this).closest("tr").find('.n15_total_price_2e').val('$' +...