CINXE.COM

IEEE Spectrum Subscription Form

<!DOCTYPE html> <!-- redirect this page if an attribute 'redirectForm' is found --> <html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <link rel="shortcut icon" type="image/ico" href="/ieee/images/ieee-favicon.ico" /> <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css"/> <link rel="stylesheet" type="text/css" media="screen" href="/ieee/css/bootstrap-multiselect.css"/> <link rel="stylesheet" type="text/css" href="/ieee/css/form-messages.css" type="text/css"> <link rel="stylesheet" type="text/css" media="screen" href="/ieee/css/omeda.css"> <link rel="stylesheet" type="text/css" media="screen" href="/ieee/css/responsive-form.css"> <link rel="stylesheet" type="text/css" media="screen" href="/ieee/css/r-client.css"> <link rel="stylesheet" type="text/css" media="print" href="/ieee/css/r-print.css"> <link rel="stylesheet" type="text/css" media="screen" href="/ieee/css/r-brand.css"> <title>IEEE Spectrum Subscription Form</title> <script src="https://code.jquery.com/jquery-1.9.1.js" integrity="sha256-e9gNBsAcA0DBuRWbm0oZfbiCyhjLrI6bmqAl5o+ZjUA=" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script> <script> if (!String.prototype.startsWith) { String.prototype.startsWith = function(searchString, position){ position = position || 0; return this.substr(position, searchString.length) === searchString; }; } </script> <script src="/ieee/js/bootstrap-multiselect.js"></script> <script> // Generated by CoffeeScript 1.8.0 /* jQuery Credit Card Validator 1.0 Copyright 2012-2015 Pawel Decowski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function() { var $, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; $ = jQuery; $.fn.validateCreditCard = function(callback, options) { var bind, card, card_type, card_types, get_card_type, is_valid_length, is_valid_luhn, normalize, validate, validate_number, _i, _len, _ref; card_types = [ { name: 'amex', pattern: /^3[47]/, valid_length: [15] }, { name: 'diners_club_carte_blanche', pattern: /^30[0-5]/, valid_length: [14] }, { name: 'diners_club_international', pattern: /^36/, valid_length: [14] }, { name: 'jcb', pattern: /^35(2[89]|[3-8][0-9])/, valid_length: [16] }, { name: 'laser', pattern: /^(6304|670[69]|6771)/, valid_length: [16, 17, 18, 19] }, { name: 'visa_electron', pattern: /^(4026|417500|4508|4844|491(3|7))/, valid_length: [16] }, { name: 'visa', pattern: /^4/, valid_length: [16] }, { name: 'mastercard', pattern: /^([5][1-5])|([2][2-7])/, valid_length: [16] }, { name: 'maestro', pattern: /^(5018|5020|5038|6304|6759|676[1-3])/, valid_length: [12, 13, 14, 15, 16, 17, 18, 19] }, { name: 'discover', pattern: /^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/, valid_length: [16] } ]; bind = false; if (callback) { if (typeof callback === 'object') { options = callback; bind = false; callback = null; } else if (typeof callback === 'function') { bind = true; } } if (options == null) { options = {}; } if (options.accept == null) { options.accept = (function() { var _i, _len, _results; _results = []; for (_i = 0, _len = card_types.length; _i < _len; _i++) { card = card_types[_i]; _results.push(card.name); } return _results; })(); } _ref = options.accept; for (_i = 0, _len = _ref.length; _i < _len; _i++) { card_type = _ref[_i]; if (__indexOf.call((function() { var _j, _len1, _results; _results = []; for (_j = 0, _len1 = card_types.length; _j < _len1; _j++) { card = card_types[_j]; _results.push(card.name); } return _results; })(), card_type) < 0) { throw "Credit card type '" + card_type + "' is not supported"; } } get_card_type = function(number) { var _j, _len1, _ref1; _ref1 = (function() { var _k, _len1, _ref1, _results; _results = []; for (_k = 0, _len1 = card_types.length; _k < _len1; _k++) { card = card_types[_k]; if (_ref1 = card.name, __indexOf.call(options.accept, _ref1) >= 0) { _results.push(card); } } return _results; })(); for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { card_type = _ref1[_j]; if (number.match(card_type.pattern)) { return card_type; } } return null; }; is_valid_luhn = function(number) { var digit, n, sum, _j, _len1, _ref1; sum = 0; _ref1 = number.split('').reverse(); for (n = _j = 0, _len1 = _ref1.length; _j < _len1; n = ++_j) { digit = _ref1[n]; digit = +digit; if (n % 2) { digit *= 2; if (digit < 10) { sum += digit; } else { sum += digit - 9; } } else { sum += digit; } } return sum % 10 === 0; }; is_valid_length = function(number, card_type) { var _ref1; return _ref1 = number.length, __indexOf.call(card_type.valid_length, _ref1) >= 0; }; validate_number = (function(_this) { return function(number) { var length_valid, luhn_valid; card_type = get_card_type(number); luhn_valid = false; length_valid = false; if (card_type != null) { luhn_valid = is_valid_luhn(number); length_valid = is_valid_length(number, card_type); } return { card_type: card_type, valid: luhn_valid && length_valid, luhn_valid: luhn_valid, length_valid: length_valid }; }; })(this); validate = (function(_this) { return function() { var number; number = normalize($(_this).val()); return validate_number(number); }; })(this); normalize = function(number) { return number.replace(/[ -]/g, ''); }; if (!bind) { return validate(); } this.on('input.jccv', (function(_this) { return function() { $(_this).off('keyup.jccv'); return callback.call(_this, validate()); }; })(this)); this.on('keyup.jccv', (function(_this) { return function() { return callback.call(_this, validate()); }; })(this)); callback.call(this, validate()); return this; }; }).call(this); /*end coffee script*/ $.validator.addMethod('ccvisa', function(value, el){ return isValidCCNumber('visa', value); }, 'Invalid Visa number.'); $.validator.addMethod('ccamex', function(value, el){ return isValidCCNumber('amex', value); }, 'Invalid American Express number.'); $.validator.addMethod('ccmaster', function(value, el){ return isValidCCNumber('master', value); }, 'Invalid MasterCard number.'); $.validator.addMethod('ccdiscover', function(value, el){ return isValidCCNumber('discover', value); }, 'Invalid Discover number.'); $.validator.addMethod('ccdinersclub', function(value, el){ return isValidCCNumber('dinersclub', value); }, 'Invalid Diner\'s Club number.'); $.validator.addMethod('ccgeneric', function(value, el){ return isValidGenericCCNumber(value); }, 'Please enter a valid Credit Card Number.'); $(document).ready(function(){ //if bill me is checked, do not show certain fields like 'amount' or 'cc number' $("input[name='paymentTypeInput']").bind('click change', function(){ if($("#setBillMe").length > 0 && $("#setBillMe").is(":checked")){ disableCreditCardFields(); $(".bill-me-hide").hide(); } else{ $(".bill-me-hide").show(); enableCreditCardFields(); } }); $('#expMonth').change(function () { $('#expMonth').removeClass('ccexpiration-date'); $('#expMonth').addClass('ccexpiration-date'); if ($("#expYear").val() != "") $("#BillingInformation_1_ExpirationDate").val($("#expMonth").val() + $("#expYear").val()); $('#expMonth').valid(); }); $('#expYear').change(function () { $('#expYear').removeClass('ccexpiration-date'); $('#expYear').addClass('ccexpiration-date'); if ($("#expMonth").val() != "") $("#BillingInformation_1_ExpirationDate").val($("#expMonth").val() + $("#expYear").val()); $('#expYear').valid(); $('#expMonth').valid(); }); //select the right CC image after a CC is entered $("#cardNum").bind('blur keyup change', function(){ var result = $("#cardNum").validateCreditCard(); var ccType = ""; if (result.card_type!=null) ccType = result.card_type.name; var isValid = result.luhn_valid; var isValidLength = result.length_valid; var ccTypeInput = $("input[name='BillingInformation_1_CreditCardType']"); if (ccType=="visa"){ <!-- $("#cardNum").addClass("ccvisa"); --> $(ccTypeInput).val("1"); $(".visaSelected").removeClass("transImage"); $(".mstcdSelected").addClass("transImage"); $(".amexSelected").addClass("transImage"); $(".discSelected").addClass("transImage"); $(".dinersSelected").addClass("transImage"); } else if (ccType=="mastercard"){ <!-- $("#cardNum").addClass("ccmaster"); --> $(ccTypeInput).val("2"); $(".visaSelected").addClass("transImage"); $(".mstcdSelected").removeClass("transImage"); $(".amexSelected").addClass("transImage"); $(".discSelected").addClass("transImage"); $(".dinersSelected").addClass("transImage"); } else if (ccType=="amex"){ <!-- $("#cardNum").addClass("ccamex"); --> $(ccTypeInput).val("3"); $(".visaSelected").addClass("transImage"); $(".mstcdSelected").addClass("transImage"); $(".amexSelected").removeClass("transImage"); $(".discSelected").addClass("transImage"); $(".dinersSelected").addClass("transImage"); } else if (ccType=="discover"){ <!-- $("#cardNum").addClass("ccdiscover"); --> $(ccTypeInput).val("4"); $(".visaSelected").addClass("transImage"); $(".mstcdSelected").addClass("transImage"); $(".amexSelected").addClass("transImage"); $(".discSelected").removeClass("transImage"); $(".dinersSelected").addClass("transImage"); } else if (ccType.startsWith("diners")){ <!-- $("#cardNum").addClass("ccdinersclub"); --> $(ccTypeInput).val("5"); $(".visaSelected").addClass("transImage"); $(".mstcdSelected").addClass("transImage"); $(".amexSelected").addClass("transImage"); $(".discSelected").addClass("transImage"); $(".dinersSelected").removeClass("transImage"); } else { <!-- $("#cardNum").addClass("error"); --> $(".visaSelected").removeClass("transImage"); $(".mstcdSelected").removeClass("transImage"); $(".amexSelected").removeClass("transImage"); $(".discSelected").removeClass("transImage"); $(".dinersSelected").removeClass("transImage"); } }); $(".promo-price-button").bind('click', function(){ $(".promo-price-button").first().valid(); }); }); $(document).ready(function(){ $("#paidform").validate({ "groups": {expDate: "ExpMon ExpYear"}, "rules": { "Products_2_Term":{required:true,validateTermAndCountry:true} }, "messages": { }, errorPlacement: function (error, element) { if (element.attr("name") == "ExpMon" || element.attr("name") == "ExpYear") error.insertAfter("#expError"); else error.insertAfter(element); }, invalidHandler: function(event, validator) { var termRadioButtons = $("input[id^='term']"); var scrollToTop = false; $.each(termRadioButtons, function(index, element){ if($(element).attr('class') && $(element).attr('class').indexOf('error') >= 0){ scrollToTop = true; } }); if(scrollToTop){ window.scrollTo(0, 0); } }, submitHandler: function(form) { // call function to stop bot attacks //OPS-56822 toggleEncryptedHiddenInputValues(true); //if the user is applying a promo, ignore form validation and reload the page if($("#applyClicked").length>0 && $("#applyClicked").val()=="true") return true; var sameBillingAddress = true; var setBillingAddressRequiredPaidScriptLevel = $("input.product-price-code:checked").not(":disabled").length > 0 && $("input.product-price-code:checked").not(":disabled").attr("data-ppc-amount") != 0; //if using the responsive radio package then set setBillingAddressRequiredPaidScriptLevel appropriately if ($("input.ppc-radio-input:checked").length) setBillingAddressRequiredPaidScriptLevel = $("input.ppc-radio-input:checked").attr("data-ppc-amount")!=0; //TODO:if we are using the radio/button include set this to true and we will need to use the back end to determine if this order is comp or not //this may only apply to HW as I didn't see these classes on the promo includes if ($("label.paid-term-radio-button input[type='radio']:checked").length) setBillingAddressRequiredPaidScriptLevel = true; if($("#toggleBillingAddress").length > 0 && $("#toggleBillingAddress").is(":checked")){ sameBillingAddress = false; } //setBillingRequired is set in the grid include and is needed for promo pages for comp orders if((($("#toggleBillingAddress").length > 0 && !$("#toggleBillingAddress").is(":checked")) || sameBillingAddress) && setBillingAddressRequiredPaidScriptLevel){ setBillingAddress(); } setProductsSubmitted(); $("#BillingInformation_1_ExpirationDate").val($("#expMonth").val()+$("#expYear").val()); var customerId = ''; if (setBillingAddressRequiredPaidScriptLevel){ if(customerId != 0) { $("#BillingInformation_1_Comment2").val(customerId); } else { var firstName = $('#FirstName').val(); var lastName = $('#LastName').val(); fullName = firstName + " " + lastName; $('#BillingInformation_1_Comment2').val(fullName); } } else { clearBillingAddress(); } updateBillingAmount(); if($(".ccgeneric").length > 0){ var ccFirstDigit = $(".ccgeneric").val().substring(0,1); //setCreditCardType(ccFirstDigit); setCreditCardTypeUsingWholeNumber($(".ccgeneric").val()); } setCASLDemoValue(); //clear any price not included in the selected (active) price group $('*[data-toggle="buttons"]').find('.promo-price-button').find('input:radio').prop('checked', false); //clear any hidden products_nnn_receive $(".promo-price-button").find("input[name^='Products_'][name$='_Receive'][value!=''][disabled!='disabled']").prop("checked", false); $(".promo-price-button").find("input[name^='Products_'][name$='_Receive'][value!=''][disabled!='disabled']").val(""); $(".promo-price-button").find("input[name^='productPriceCode_'][value!='']:checked").each(function () { //set hidden products_nnn_receive that have corresponding radio buttons checked $(this).siblings("input:hidden").prop("checked", true); $(this).siblings("input:hidden").val("1"); }); if ($("#grecaptcha").is(':visible')) { var response = grecaptcha.getResponse(); if (response.length === 0 && $("#grecaptcha").is(':visible')) { alert("Please verify that you are not a robot."); return false; } else $("#recaptchaResponse").val(response); } var validForSubmission = false; if($(".promo-price-button").length === 0){ //if promo pricing is not being used, do not prevent submit from happening validForSubmission = true; } else if ($("#promo-price-error").length > 0 && $(".promo-price-button.active").html() == undefined) { $("#promo-price-error").html("Your term is required."); $("#promo-price-error").show(); $("#promo-price-error")[0].scrollIntoView(); } else { $("#promo-price-error").hide(); validForSubmission = true; } if (validForSubmission) { var sbut = $("input[type=submit]", form); sbut.attr('disabled', 'disabled'); form.submit(); } } }); initializeDemographics(); //if we only have 1 term available, pre-select the only term option we have if(("" === "" && "" === "") || ("" === "" && "" === "") || ("" === "" && "" === "")){ $("input[name=Products_2_Term]").closest("label").click(); } $('#EMAIL_ADDRESS2').bind("paste",function(e) { e.preventDefault(); }); $("#Emails_GROUP1_EmailAddress").bind("change keyup",function(){ $("#confirm-email").removeClass("hidden"); }); var shippingCountry = $("select[name=Addresses_GROUP1_CountryCode]"); $(shippingCountry).bind("change",function(){ $(".paid-term-radio-button").removeClass("disabled").removeAttr("title"); $(".special-term-error").hide(); //if any foreign non-CAN countries are selected.. if($(this).val() !== "USA" && $(this).val() !== "CAN" && ($(this).val() !== "" || $("#COUNTRY").val() !== "")){ if("" === ""){//disable the term2 button if there is no price for 2 year international $(".paid-term-2-label").addClass("disabled").removeClass("active"); $("#term2radio").prop("checked",false); } if("" === ""){//disable the term3 button if there is no price for 3 year international $(".paid-term-3-label").addClass("disabled").removeClass("active"); $("#term3radio").prop("checked",false); } } //if Canada is selected.. else if($(this).val() === "CAN"){ if("" === ""){//disable the term2 button if there is no price for 2 year CAN $(".paid-term-2-label").addClass("disabled").removeClass("active"); $("#term2radio").prop("checked",false); } if("" === ""){//disable the term3 button if there is no price for 3 year CAN $(".paid-term-3-label").addClass("disabled").removeClass("active"); $("#term3radio").prop("checked",false); } } }); //if country or price code is changed, validate the price code against country selected $("input[name^=productPriceCode_], select[name=Addresses_GROUP1_CountryCode]").on("change",function(){ if($(".ppc-radio-input:checked").length > 0){ $(".ppc-radio-input:checked").valid(); } }); $(".paid-term-radio-button").bind("click",function(){ if($(this).hasClass("disabled")){ return false; } }); if("Products_2_Term" !== ""){ $("input[name=Products_2_Term]").bind("change",function(){ $(this).valid(); }); } if("Products_2_RequestedVersion" !== ""){ $("input[name=Products_2_RequestedVersion]").bind("change",function(){ $(this).valid(); }); } $('#Addresses_GROUP1_CountryCode').bind("change",function(){ if ($(this).val() == "IRN" && $('#setBillMe').is(':checked') ){ alert("We are sorry, but we are no longer accepting billable orders from your area. Please provide payment information for your order. We apologize if this causes any inconvenience."); $('#submit-button').prop("disabled",true); } else $('#submit-button').prop("disabled",false); }); $('#setBillMe').bind("change",function(){ if ($(this).is(':checked') && $('#Addresses_GROUP1_CountryCode').val()=="IRN" ){ alert("We are sorry, but we are no longer accepting billable orders from your area. Please provide payment information for your order. We apologize if this causes any inconvenience."); $('#submit-button').prop("disabled",true); } else $('#CreditCard').bind("change",function(){ if ($(this).is(':checked') && $('#Addresses_GROUP1_CountryCode').val()=="IRN"){ $('#submit-button').prop("disabled",false); } }); }); var isMobileAgent = ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|windows phone|kindle|silk|silk-accelerated|kfot|FKTT|KFJWA|kfjwi|KFSOWI|KFTHWA|KFTHWI|KFAPWA|KFAPWI/i.test(navigator.userAgent.toLowerCase()) ); if(isMobileAgent){ $(".multi-select-help-text").addClass("hidden"); } $('#EMAIL_ADDRESS2').bind("paste",function(e) { e.preventDefault(); }); $("#Emails_GROUP1_EmailAddress").bind("change keyup",function(){ $("#confirm-email").removeClass("hidden"); }); $(document).ready(function(){ if("Products_2_RequestedVersion" !== "" && $("input[name=Products_2_RequestedVersion]:checked").length > 0){ $("input[name=Products_2_RequestedVersion]:checked").click(); } }); $(".nlet").bind("click change",function(){ if($("input[name=firstProductCheckbox]").length > 0){ $("input[name=firstProductCheckbox]").valid(); } }); $("input[name^=Products_][name$=_Receive]").bind("click change",function(){ if($("input[name=firstProductCheckbox]").length > 0){ $("input[name=firstProductCheckbox]").valid(); } }); if("" !== "" && "" == "true" && $("input[name=firstProductCheckbox].nlet-only").length > 0){ $("input[name=firstProductCheckbox].nlet-only").rules('add', { messages: {required: "Please select at least one newsletter." } }); } $("#add-passalong-button").bind("click",function(){ var visiblePassalongGroups = $(".passalong-field-container:visible").length; //do not allow user to add more than 5 if(""!="" && -1>0){ if(visiblePassalongGroups === -1) $(this).hide(); } else{ if(visiblePassalongGroups === 4) $(this).hide(); } //display the next passalong group $(".passalong-field-container.pfc0" + (visiblePassalongGroups+1)).show(); //and scroll it into view $('html, body').animate({ scrollTop: $(".passalong-field-container.pfc0" + (visiblePassalongGroups+1)).offset().top }, 1000); }); $("select[name^=Demographic_]").bind("change", function(){ var selectedOption = $("option:selected", this); var writeInDescContainer = $(this).closest("div").find(".demo-other-input-container"); if(selectedOption && selectedOption[0] && selectedOption[0].className.indexOf('demographic-other-value') > 0){ $(writeInDescContainer).show(); } else{ $(writeInDescContainer).hide(); } }); $(":radio[name^=Demographic_]").bind("click", function(){ var selectedOption = this; var writeInDescContainer = $(this).parent().parent().siblings().last().find(".demo-other-input-container"); if(selectedOption && $(selectedOption).attr("class").indexOf('demographic-other-value') > 0){ $(writeInDescContainer).show(); } else{ $(writeInDescContainer).hide(); } }); $.each($(".demographic-other-value"), function(){ var selectedOption = this; var writeInDescContainer = $(this).parent().parent().siblings().last().find(".demo-other-input-container"); if(selectedOption && $(selectedOption).is(":checked")){ $(writeInDescContainer).show(); $(writeInDescContainer).children().removeAttr("disabled"); } else{ $(writeInDescContainer).hide(); } }); $("input[name=Products_2_Receive], input.consol-receive").bind("change click", function(){ if(($(this).val() === "0" || $(this).val() === "No") && $(this).is(":checked") && $("input.consol-receive[value=1]:checked").length < 1){ $("#requested-version-section").hide(); disablePassalongFields(); } else{ $("#requested-version-section").show(); if(!$("#passalong-section").hasClass("hide-foreign")){ enablePassalongFields(); } } $(this).valid(); }); $("input.consol-receive").on("change click", function(){ togglePassalongProductsEnabled(); $(this).valid(); }); $("#autoRenewCode").on("change click", function(){ if($(this).is(':checked')){ $(this).val('5'); } else{ $(this).val('0'); } }); if("Products_2_RequestedVersion" !== ""){ $("input[name=Products_2_RequestedVersion]").on("change",function(){ //passalong should not be allowed if digital is selected if($(this).val() === "D" && !$(this).hasClass("enable-digital-passalong")){ disablePassalongFields(); } else{ enablePassalongFields(); } $(this).valid(); }); } $("select[name=Addresses_GROUP1_CountryCode]").bind("change",function(){ updateStateOptions($(this).val(), $("select[name=Addresses_GROUP1_RegionCode]")); if(typeof toggleConsolForeignDigitalProducts === "function"){ toggleConsolForeignDigitalProducts($(this).val(), "B");//prepop "Both" if possible } }); $("input[name^=Products_][name$=_Receive]:visible, input.consol-receive:visible").prop("checked",false).closest("label").removeClass("active"); //for each multiselect, bind the jquery multiselect plugin method $.each($("select.demographic[multiple=multiple]"),function(index,element){ bindJqueryMultiselect("#" + $(this).attr("id"), $(this).find("option.noneOfTheAbove").val()); }); //TODO: loop through demo_ids and check for demo.parent.# properties to allow for multiple parent/child triggers // or.. use classes somehow to do these triggers, loop through list of demo ids and add class names to demos that need to trigger things /* these next 2 items set a state to check for when testing if the back button was used. Add this to a page to test this state: window.onhashchange = function() { if (window.innerDocClick) { //other misc events happen here } else { $(".XXXX").trigger("change");//Browser back button was clicked so trigger any necessary JS } } */ document.onmouseover = function() { //User's mouse is inside the page. window.innerDocClick = true; } document.onmouseleave = function() { //User's mouse has left the page. window.innerDocClick = false; } var shippingCountry = $("select[name=Addresses_GROUP1_CountryCode]"); $(".CASL-dropdown").bind("change",function(){ var countrySelected = $(this).val(); if(countrySelected === "USA" || countrySelected === "CAN"){ $(shippingCountry).val(countrySelected); caslCountryChanged($(this),$(".nlet")); } else{ $(shippingCountry).val(""); } shippingCountry.change(); $(this).addClass("changed"); }); $(shippingCountry).bind("change",function(){ var countrySelected = $(this).val(); var countryChanged = true; var region = $('#Addresses_GROUP1_CountryCode option:selected').attr('region'); if(countrySelected === "USA" || countrySelected === "CAN" || (countrySelected === "" && $(".CASL-dropdown").val() != "FOREIGN")){ $(".CASL-dropdown").val(countrySelected); } else{ $(".CASL-dropdown").val("FOREIGN"); } if(countryChanged){ caslCountryChanged($(this),$(".nlet")); } $("#COUNTRY").addClass("changed"); $(this).addClass("changed"); }); $('input[class*="thirdParty"]').change(function() { setCASLDemoValue(); }); }); </script> <script type="text/javascript" src="/ieee/js/creditcard.js"></script> <script type="text/javascript" src="/ieee/js/cc-validation-methods.js"></script> <script> <!-- as of 10/26/18 this file is being included on pages that do NOT use JSTL --> <!-- do not allow @ sign --> $.validator.addMethod('excludeChar', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || !(/[@]/.test(value)); },"That is not a valid entry."); <!-- do not allow @ sign french--> $.validator.addMethod('excludeCharFr', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || !(/[@]/.test(value)); },"Ceci n'est pas une entr茅e valide."); <!--allows 1234567890, A-Z, a-z, !@#$%^&*()_+-=,.<>/?;':"[]{}\|`~ OR nothing --> $.validator.addMethod('allStandardChars', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /[ -~\~]+$/.test(value); },"Only english characters allowed."); <!--allows 1234567890, A-Z, a-z, !@#$%^&*()_+-=,.<>/?;':"[]{}\|`~ --> $.validator.addMethod('allStandardCharsFr', function (value, element) { return /[ -~\~]+$/.test(value); },"Seuls les caract猫res anglais sont autoris茅s."); <!--allows 1234567890, A-Z, a-z, !@#$%^&*()_+-=,.<>/?;':"[]{}\|`~ OR nothing --> $.validator.addMethod('allStandardCharsOptional', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /[ -~\~]+$/.test(value); },"Only english characters allowed."); <!--allows 1234567890, A-Z, a-z, !@#$%^&*()_+-=,.<>/?;':"[]{}\|`~ OR nothing --> $.validator.addMethod('allStandardCharsOptionalFr', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /[ -~\~]+$/.test(value); },"Seuls les caract猫res anglais sont autoris茅s."); <!--allows 12345-1234, 123456789, 12345, a1a 1a1, a1a1a1 --> $.validator.addMethod('usPostalCode', function (value) { return /^((\d{5}-?\d{4})|(\d{5}))$/.test(value); },"Please enter a valid US postal code."); <!--allows a1a 1a1, a1a1a1 --> $.validator.addMethod('canadaPostalCode', function (value) { return /^([a-zA-Z]\d[a-zA-Z]\s?\d[a-zA-Z]\d)$/.test(value); },"Please enter a valid Canadian postal code."); <!--allows 12345-1234, 123456789,12345, a1a 1a1, a1a1a1 --> $.validator.addMethod('postalCode', function (value) { return /^((\d{5}-?\d{4})|(\d{5})|([a-zA-Z]\d[a-zA-Z]\s?\d[a-zA-Z]\d))$/.test(value); },"Please enter a valid US or Canadian postal code."); <!--(123)123-1234 or (123) 123-1234 or 123-123-1234 or 123.123.1234, etc--> $.validator.addMethod('phone', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^(\(([0-9]{3})\)[-. ]?([0-9]{3})[-. ]?([0-9]{4})|([0-9]{3})[-. ]?([0-9]{3})[-. ]?([0-9]{4}))$/.test(value); },"Please enter a valid phone number."); <!--allows numbers, spaces, ., (, ), -, + --> $.validator.addMethod('genericPhone', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\d\s\.\(\)\-\+]{0,}(?=\d{3,})[\d\s\.\(\)\-\+]{0,}$/.test(value); },"Please enter a valid phone number."); <!--allows numbers, spaces, ., (, ), -, + --> $.validator.addMethod('genericPhoneFr', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\d\s\.\(\)\-\+]{0,}(?=\d{3,})[\d\s\.\(\)\-\+]{0,}$/.test(value); },"s'il vous pla卯t entrer un num茅ro de t茅l茅phone valide."); <!--allows numbers, spaces, ., (, ), -, + --> $.validator.addMethod('genericFax', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\d\s\.\(\)\-\+]{0,}(?=\d{3,})[\d\s\.\(\)\-\+]{0,}$/.test(value); },"Please enter a valid fax number."); <!--(123)123-1234 or (123) 123-1234 or 123-123-1234 or 1231231234, etc--> $.validator.addMethod('phoneCustom', function (value) { return /^\(?([0-9]{3})\)?[- ]?([0-9]{3})[- ]?([0-9]{4})$/.test(value); },"Please enter a valid phone number."); <!--(123)123-1234 or (123) 123-1234 or 123-123-1234 or 1231231234, etc--> $.validator.addMethod('faxCustom', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^\(?([0-9]{3})\)?[- ]?([0-9]{3})[- ]?([0-9]{4})$/.test(value); },"Please enter a valid fax number."); <!--allows numbers, spaces, (, ), -, + --> $.validator.addMethod('genericPhoneCustom', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\d\s\(\)\-\+]{10,}$/.test(value); },"Please enter a valid phone number."); <!--allows international phone number --> $.validator.addMethod('internationalPhoneCustom', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)\d{1,14}$/.test(value); },"Please enter a valid international phone number."); <!--allows number only --> $.validator.addMethod('phoneDigits', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[0-9]+$/.test(value); },"Please enter a valid international phone number."); <!--allows upper/lower case alph, spaces, . and - --> $.validator.addMethod('alpha', function (value) { return /^[-\.\sa-zA-Z]+$/.test(value); },"That is not a valid entry."); <!--allows upper/lower case alph, spaces, . and - --> $.validator.addMethod('alphaFr', function (value) { return /^[-\.\sa-zA-Z]+$/.test(value); },"Ceci n'est pas une entr茅e valide."); <!--minimum length of 2 --> $.validator.addMethod('minLength', function (value) { return /^.{2,}$/.test(value); },"That is not a valid entry."); <!--minimum length of 2 french--> $.validator.addMethod('minLengthFr', function (value) { return /^.{2,}$/.test(value); },"Ceci n'est pas une entr茅e valide."); <!--allows upper/lower case alph, spaces, ., - and ' --> $.validator.addMethod('alphaApostrophe', function (value) { return /^[-\.\sa-zA-Z']+$/.test(value); },"That is not a valid entry."); <!--allows upper/lower case alph, spaces, ., - and ' --> $.validator.addMethod('alphaApostropheFr', function (value) { return /^[-\.\sa-zA-Z'茅脿芒盲猫茅锚毛卯茂么霉没眉每莽]+$/i.test(value); },"Ceci n'est pas une entr茅e valide."); <!--allows upper/lower case alph, spaces, ., - and ' --> $.validator.addMethod('alphaApostropheOptional', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[-\.\sa-zA-Z']+$/.test(value); },"That is not a valid entry."); <!--allows upper/lower case alph, spaces, ., - and ' --> $.validator.addMethod('alphaApostropheOptionalFr', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[-\.\sa-zA-Z']+$/.test(value); },"Ceci n'est pas une entr茅e valide."); <!--allows upper/lower case alph, and spaces--> $.validator.addMethod('alphaOptional', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[a-zA-Z\s]+$/.test(value); },"That is not a valid entry."); <!--allows upper/lower case alph, and spaces--> $.validator.addMethod('alphaOptionalFr', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[a-zA-Z\s]+$/.test(value); },"Ceci n'est pas une entr茅e valide."); <!--allows upper/lower case alph, numbers, spaces, . and - --> $.validator.addMethod('alphaNumeric', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[-\.\sa-zA-Z\d]+$/.test(value); },"That is not a valid entry."); <!--allows upper/lower case alph, numbers, spaces, . and - --> $.validator.addMethod('alphaNumericFr', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[-\.\sa-zA-Z\d]+$/.test(value); },"Ceci n'est pas une entr茅e valide."); <!--allows upper/lower case alph, numbers, and spaces ONLY --> $.validator.addMethod('alphaNumericSpaceOnly', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\sa-zA-Z\d]+$/.test(value); },"That is not a valid entry."); <!--allows upper/lower case alph, numbers, and spaces ONLY --> $.validator.addMethod('alphaNumericSpaceOnlyFr', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\sa-zA-Z\d]+$/.test(value); },"Ceci n'est pas une entr茅e valide."); <!--when this class is added to a field the error message is will show --> $.validator.addMethod('province', function (value) { return false; },"Invalid Canadian province/postal code combination."); <!--when this class is added to a field the error message is will show --> $.validator.addMethod('provinceFr', function (value) { return false; },"Entr茅e invalide pour province canadienne/code postal."); <!--when this class is added to a field the error message is will show --> $.validator.addMethod('country', function (value) { return false; },"Invalid State/Country combination."); <!--when this class is added to a field the error message is will show --> $.validator.addMethod('countryFr', function (value) { return false; },"Entr茅e invalide pour province/pays."); <!--when this class is added to a field the error message will show --> $.validator.addMethod('print-usa-only', function (value) { return false; },"Free print subscription is only available for US addresses. <br/>Please select the 'Digital Version'."); <!-- Compare label with blank and default (parameter) value --> $.validator.addMethod('requiredDefault', function(value, element, param) { return value && value != param; },'Please enter a value.'); <!-- Compare label with blank and default (parameter) value --> $.validator.addMethod('requiredFr', function(value) { return value && value != ''; },'Ce champ est requis.'); <!--if the country is not = USA, an error message will be shown --> $.validator.addMethod('usaOnly', function (value) { return false; },"A Paid subscription is required for addresses outside of the US."); <!--validate address to have at least 1 alphanumeric character before allowing ., --> $.validator.addMethod("addressValidate", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || value == value.match(/^[a-zA-Z0-9]{1}[a-zA-Z0-9 .,]*$/); },"Please enter a valid address."); <!--validate username to have only certain characters --> $.validator.addMethod("username", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[a-zA-Z0-9!$'\-\.@_~]+$/.test(value); },"Usernames may only contain letters, numbers, and !$'-.@_~"); <!-- if we ever decide we need to prevent leading 0s update to ^[1-9]+\d+$ --> $.validator.addMethod('postId', function (value, element) { return (this.optional(element) && $(element).val().length === 0) || (value.match(/^\d+$/) && parseInt(value) != 0); },"Please enter valid account number."); $.validator.addMethod("needsSelection", function(value, element) { var count = $(element).find('option:selected').length; return count > 0; },"Please select at least one option."); $.validator.addMethod("email", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^(([a-zA-Z0-9_.'-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z]){2,})?$/.test(value); },"Please enter a valid email address."); $.validator.addMethod("emailFr", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^(([a-zA-Z0-9_.'-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z]){2,})?$/.test(value); },"Veuillez saisir une adresse de courriel valide."); $.validator.addMethod("studentEmail", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /(.edu){1}$/.test(value); },"Please enter a valid .edu email address"); $.validator.addMethod("studentEmailExtended", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /(.edu){1}$/.test(value) || /(.ac){1}$/.test(value)|| /(.uk){1}$/.test(value); },"Please enter a valid .edu .ac .uk email address"); $.validator.addMethod("validDomains", function(value, element) { return (this.optional(element) && $(element).val().length === 0) ; },"Please enter company email address."); $.validator.addMethod("confirmEmail", function(value, element) { return (value).toLowerCase() === ($("#Emails_GROUP1_EmailAddress").val()).toLowerCase(); },"Please enter the same email as above."); $.validator.addMethod("confirmUsernameAsEmail", function(value, element) { return (value).toLowerCase() === ($("#Username").val()).toLowerCase(); },"Please enter the same email as above."); $.validator.addMethod("confirmEmailFr", function(value, element) { return (value).toLowerCase() === ($("#Emails_GROUP1_EmailAddress").val()).toLowerCase(); },"Entrez le m锚me email que ci-dessus."); $.validator.addMethod("confirmUsernameAsEmailFr", function(value, element) { return (value).toLowerCase() === ($("#Username").val()).toLowerCase(); },"Entrez le m锚me email que ci-dessus."); $.validator.addMethod("confirmPassword", function(value, element) { return value === $("input#password").val(); },"Please enter the same password as above."); $.validator.addMethod("confirmPasswordFr", function(value, element) { return value === $("input#password").val(); },"Entrez le m锚me mot de passe que ci-dessus."); <!-- validate password as described in error message --> $.validator.addMethod("auth-password", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{1,}(.*)$/.test(value); },"Please enter at least 6 characters, and include a minimum of 1 lower-case letter(s), 1 upper case letter(s) and 1 number(s)"); <!-- validate password as described in error message --> $.validator.addMethod("auth-passwordFr", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{1,}(.*)$/.test(value); },"Veuillez saisir au moins 6 caract猫res et inclure au moins une lettre minuscule, une lettre majuscule et un chiffre."); <!-- validate password as described in error message --> $.validator.addMethod("limit-password", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\.\sa-zA-Z\d~!@#$%^&*()_\-+=?.]+$/.test(value); },"Please enter only alphanumeric characters or ~!@#$%^&*()_-+=?.<>"); <!-- validate password as described in error message --> $.validator.addMethod("limit-passwordFr", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^[\.\sa-zA-Z\d~!@#$%^&*()_\-+=?.]+$/.test(value); },"Veuillez saisir seulement des caract猫res alphanum茅riques ou sp茅ciaux ~!@#$%^&*()_-+=?.<>"); <!-- validate optional password field --> $.validator.addMethod("optionalPassword", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || btoa($(element).val())=== ""; },"Invalid Password"); <!-- basic validation for prices (should be valid integer or double) --> $.validator.addMethod("price", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || /^\d{0,8}(\.\d{1,4})?$/.test(value);<!-- the price is right! --> },"Please enter a valid amount"); <!-- require at least 2 names be provided (separated by a space) - generally for NameOnCard --> $.validator.addMethod("first-last-required", function(value, element) { return (this.optional(element) && $(element).val().length === 0) || value.match(/\S+/g).length>1; },"Enter a first and last name"); <!-- validate price code radio against country --> $.validator.addMethod("ppc-radio-input", function(value, element) { var selectedCountry = $("[name^=Addresses_][name$=_CountryCode]").not(":disabled").val(); var selectedGeoLocation = $(".ppc-radio-input:checked").attr("data-ppc-geolocation"); var valid = true; if((selectedCountry && selectedCountry.length > 0) && (selectedGeoLocation && selectedGeoLocation.length > 0)){ if((selectedGeoLocation === "1" && selectedCountry !== "USA") || (selectedGeoLocation === "2" && selectedCountry !== "CAN") || (selectedGeoLocation === "3" && selectedCountry === "USA") || (selectedGeoLocation === "4" && selectedCountry !== "MEX")){ valid = false; } } return valid; },"The country you selected is not valid for the selected payment option."); <!-- validate price code radio against country for gift page--> $.validator.addMethod("ppc-radio-input-gift", function(value, element) { var selectedCountry = $("[name^=Addresses_][name$=_CountryCode]").not(":disabled").val(); var selectedGeoLocation = $(".ppc-radio-input-gift:checked").attr("data-ppc-geolocation"); var valid = true; if((selectedCountry && selectedCountry.length > 0) && (selectedGeoLocation && selectedGeoLocation.length > 0)){ if((selectedGeoLocation === "1" && selectedCountry !== "USA") || (selectedGeoLocation === "2" && selectedCountry !== "CAN") || (selectedGeoLocation === "3" && selectedCountry === "USA") || (selectedGeoLocation === "4" && selectedCountry !== "MEX")){ valid = false; } } return valid; },"The country you selected is not valid for the selected payment option."); <!-- email is required for certain payment options, validate it here --> $.validator.addMethod("ppc-email-required", function(value, element) { var valid = true; if($(".ppc-radio-input:checked").hasClass("ppc-email-required")){ //if there are gift recipient emails, loop through all of them to determine whether any have been left empty var giftRecipientEmails = $("input[name^=recipient][name$=_EmailAddress]").not(":disabled"); if($(giftRecipientEmails).length > 0){ $.each(giftRecipientEmails, function(index,element){ if($(element).val() === ""){ valid = false; } }); } else{ valid = $("input[name=Emails_GROUP1_EmailAddress]").val().length > 0; } } return valid; },"Email address is required for the selected payment option."); <!-- validate passalong product, at least one should be checked --> $.validator.addMethod("passalongProduct", function(value, element) { var valid = false; var passalongClass = findPassalongClassForElement($(element)); var isEmpty = true; //only need to select a passalong product if any of the passalong group's other fields have been filled out $.each($('.' + passalongClass + ".passalongField"), function(index, item) { if (item != null && $(item).val() != "") { isEmpty = false; } }); if (isEmpty) { valid = true; } else { valid = isOneCheckedByClass(passalongClass + ".pg-product");//PG01.pg-product for example.. } return valid; },"Please select at least one product."); <!-- if auto renew checkbox must be checked --> $.validator.addMethod("autoRenewRequired", function(value, element) { var valid = true; if($("#autoRenewCode").is(':checked')){ valid = true; } else{ valid = false; } return valid; },"Please opt-in to the full terms and conditions and privacy policy of the site to place your order"); <!--Validate if province matches first letter of postal code--> function validateProvince(regionCode, postalCode){ var region = '#' + regionCode; var postal = '#' + postalCode; var CanCodes = new Array("AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT"); var CanLetters = new Array("T","UV","R","E","A","B","X","X","KLMNP","C","GHJ","S","Y"); var firstLetter = $(postal).val() ? $(postal).val().substring(0,1).toUpperCase() : ""; var validate = false; for (i=0; i < 13; i++){ if ($(region).val() == CanCodes[i]){ if (CanLetters[i].indexOf(firstLetter,0) == -1){ validate = true; } } } if (validate){ $(postal).addClass('province'); }else{ $(postal).removeClass('province'); } if ($(postal).length > 0 && $(postal).val() != "") $(postal).valid(); } function validateCanadianPostalCode(regionCode, postalCode){ var CanCodes = new Array("AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT"); var CanLetters = new Array("T","UV","R","E","A","B","X","X","KLMNP","C","GHJ","S","Y"); var $regionEl = $('#' + regionCode); var region = $regionEl.val(); var $postalEl = $('#' + postalCode); var postal = $postalEl.val(); $postalEl.removeClass('province'); if(isProvince(regionCode) && postal){ var provinceIndex = CanCodes.indexOf(region); if(provinceIndex != -1){ var firstLetter = postal.substring(0,1).toUpperCase(); if(CanLetters[provinceIndex].indexOf(firstLetter, 0) == -1) $postalEl.addClass('province'); $postalEl.valid(); } } } <!--Checks if the region selection is a Canadian province--> function isProvince(regionCode){ var CanCodes = new Array("AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT"); var province = false; var region = '#' + regionCode; for (i=0; i < 13; i++){ if ($(region).val() == CanCodes[i]){ province = true; } } return province; } <!--Validates that the region and country are a valid combo--> function validateRegionCountry(countryCode, regionCode){ var country = '#' + countryCode; var region = '#' + regionCode; var validate = true; if($(region).val() == ""){ validate = false; } else if(isProvince(regionCode)){ if ($(country).val() == "CAN") validate = false; }else if($(region).val() == 53){ if (!($(country).val() == "USA" || $(country).val() == "CAN")) validate = false; }else { if ($(country).val() == "USA") validate = false; } if (validate){ $(country).addClass('country'); }else{ $(country).removeClass('country'); } if ($(country).val() != "" && $(region).val() != "") $(country).valid(); } <!--Validates if the country is not USA--> function isUnitedStates(countryCode){ var country = '#' + countryCode; if ($(country).val() != "USA"){ $(country).addClass('usaOnly'); }else{ $(country).removeClass('usaOnly'); } if ($(country).val() != "") $(country).valid(); } function isCanada($countryEl){ var code = $countryEl.val(); if(code == 'CAN'){ return true; } return false; } <!--validates the phone number format based on the country--> function validateAllPhone(countryCode, phoneField){ var country = '#' + countryCode; var phone = '#' + phoneField; if($(phone).length){ if ($(phone).val() != ""){ if ( $(country).val() == "USA" || $(country).val() == "CAN" ) { $(phone).removeClass('genericPhone').addClass('phone'); }else{ $(phone).removeClass('phone').addClass('genericPhone'); } }else{ $(phone).removeClass('phone genericPhone'); } <!--re-validate the field--> if( $(phone).val() != "") $(phone).valid(); } } <!--validates phone for USA and CAN ONLY--> function validatePhone(phoneField){ var phone = '#' + phoneField; if ($(phone).val() != ""){ $(phone).addClass('phone'); }else{ $(phone).removeClass('phone '); } <!--re-validate the field--> if( $(phone).val() != "") $(phone).valid(); } <!--validates title--> function validateTitle(titleField){ var title = '#' + titleField; if ($(title).val() != ""){ $(title).addClass('alphaNumericSpaceOnly'); }else{ $(title).removeClass('alphaNumericSpaceOnly error'); } <!--re-validate the field--> $(title).valid(); } <!--validates the postal code based on the country--> function validatePostalCode(countryCode, postalCode){ var country = '#' + countryCode; var postal = '#' + postalCode; var hideRequiredAsterisk = false; if ( $(country).val() == "USA") { $(postal).removeClass('canadaPostalCode').addClass('required usPostalCode'); } else if ( $(country).val() == "CAN" ){ $(postal).removeClass('usPostalCode').addClass('required canadaPostalCode'); } else{ $(postal).removeClass('required usPostalCode canadaPostalCode').addClass('allStandardCharsOptional'); $(postal).valid(); hideRequiredAsterisk = true; } if(hideRequiredAsterisk){ if($(".zip-required-asterisk").length && !$(country).hasClass("billing-address-field")){ $(".zip-required-asterisk").hide(); } else if($(".billing-zip-required-asterisk").length && $(country).hasClass("billing-address-field")){ $(".billing-zip-required-asterisk").hide(); } } else{ if($(".zip-required-asterisk").length && !$(country).hasClass("billing-address-field")){ $(".zip-required-asterisk").show(); } else if($(".billing-zip-required-asterisk").length && $(country).hasClass("billing-address-field")){ $(".billing-zip-required-asterisk").show(); } } <!--re-validate the field--> if( $(postal).length > 0 && $(postal).val() != "") $(postal).valid(); } <!--validates the postal code based for US--> function validateUSPostalCode(postalCode){ var postal = '#' + postalCode; $(postal).addClass('required usPostalCode'); <!--re-validate the field--> $(postal).valid(); } <!--OTHER VAlUE - removes any text in the other box --> function removeOtherValue(radioButton, otherTextbox){ var other = '#' + otherTextbox; if ($(radioButton).is(':checked')) { $(other).removeAttr("disabled").addClass("required"); } else { $(other).val("").attr("disabled", true).removeClass("required"); } $(other).valid(); } <!--YES/NO - forward page if user chooses nos --> function yesNo(form){ if ($("input[name^='Products_2_Receive']:checked")>0){ var yesNo = $("input[name^='Products_' + 2 + '_Receive']:checked").val(); if (yesNo == "0") jQuery('form#' + form).unbind('submit').submit(); } } <!--Checks if the selected country is allowd print--> function validateDigitalPrint(countryCode, printAllowedArray, alertMsg){ var printArray = printAllowedArray; var country = '#' + countryCode; var printAllowed = false; for (i=0; i < printArray.length; i++){ if ($(country).val() == printArray[i]){ printAllowed = true; break; } } if (printAllowed){ $('#Print').prop('disabled',false); $('#Both').prop('disabled',false); }else{ if($('#Print').is(':checked') || $('#Both').is(':checked') || $("input[id=Print][type='hidden']").length > 0) { alert(alertMsg); } $('#Print').prop('checked', false); $('#Print').prop('disabled',true); $('#Both').prop('checked', false); $('#Both').prop('disabled',true); } } <!--Checks if the selected country is allowed print on responsive forms--> function validateRequestedVersion(countryCode, printAllowedArray){ var printArray = printAllowedArray; var country = '#' + countryCode; var printAllowed = false; for (i=0; i < printArray.length; i++){ if ($(country).val() == printArray[i]){ printAllowed = true; break; } } var foundPrint = false; $("[name*=_RequestedVersion]:checked").each(function() { if ($(this).val() == 'P' || $(this).val() == 'B') { foundPrint = true; } }); if(foundPrint && !printAllowed){ $(country).addClass('print-usa-only'); } else { $(country).removeClass('print-usa-only'); } } <!--Checks if the region selection is a based on the class of the country--> function validateDigitalPrintClass(countryCode, printAllowedArray, alertMsg){ var printArray = printAllowedArray; var country = '#' + countryCode; var printAllowed = false; var classes = $("option:selected", $(country)).attr("class"); for (i=0; i < printArray.length; i++){ if (classes == printArray[i]){ printAllowed = true; break; } } if (printAllowed){ $('#Print').prop('disabled',false); $('#Both').prop('disabled',false); }else{ if($('#Print').is(':checked') || $('#Both').is(':checked')) { alert(alertMsg); } $('#Print').prop('checked', false); $('#Print').prop('disabled',true); $('#Both').prop('checked', false); $('#Both').prop('disabled',true); } } function validateCustomAllPhone(countryCode, phoneField){ var country = '#' + countryCode; var phone = '#' + phoneField; if ($(phone).val() != ""){ var genericClass = "genericPhoneCustom"; var customClass = "phoneCustom"; if($(phone).hasClass("genericFax")){ genericClass = "genericFaxCustom"; customClass = "faxCustom"; } if ( $(country).val() == "USA" || $(country).val() == "CAN" ) { $(phone).removeClass(genericClass).addClass(customClass); }else{ $(phone).removeClass(customClass).addClass(genericClass); } }else{ $(phone).removeClass(customClass + ' ' + genericClass); } if( $(phone).val() != "") $(phone).valid(); } function validateCustomAllPhoneInternational(countryCode, phoneField){ var country = '#' + countryCode; var phone = '#' + phoneField; if ($(phone).val() != ""){ if ( $(country).val() == "USA" || $(country).val() == "CAN" ) { $(phone).removeClass('genericPhoneCustom').addClass('phoneCustom'); }else{ $(phone).removeClass('phoneCustom').addClass('internationalPhoneCustom'); } }else{ $(phone).removeClass('phoneCustom internationalPhoneCustom'); } if( $(phone).val() != ""){ $(phone).valid(); } } function validateCustomPhone(phoneField){ var phone = '#' + phoneField; if ($(phone).val() != ""){ $(phone).addClass('phoneCustom'); }else{ $(phone).removeClass('phoneCustom'); } if( $(phone).val() != "") $(phone).valid(); } var getCreditCard = function(name){ var ccs = []; /* ccs["visa"] = {prefix: 4, lengths: [13,16]}; ccs["master"] = {prefix: 5, lengths: [16]}; ccs["amex"] = {prefix: 3, lengths: [15]}; ccs["discover"] = {prefix: 6, lengths: [16]}; ccs["dinersclub"] = {prefix: 2, lengths: [14,16]}; */ ccs["visa"] = { cardName: "Visa", lengths: [13,16], prefixes: [4], checkdigit: true }; ccs["master"] = { cardName: "Master", lengths: [16], prefixes: [51,52,53,54,55,22], checkdigit: true }; ccs["dinersclub"] = { cardName: "DinersClub", lengths: [14,16], prefixes: [305,36,38,54,55], checkdigit: true }; ccs["carteblanche"] = { cardName: "CarteBlanche", lengths: [14], prefixes: [300,301,302,303,304,305], checkdigit: true }; ccs["amex"] = { cardName: "AmEx", lengths: [15], prefixes: [34,37], checkdigit: true }; ccs["discover"] = { cardName: "Discover", lengths: [16], prefixes: [6011,622,64,65], checkdigit: true }; ccs["jcb"] = { cardName: "JCB", lengths: [16], prefixes: [35], checkdigit: true }; ccs["enroute"] = { cardName: "enRoute", lengths: [15], prefixes: [2014,2149], checkdigit: true }; ccs["solo"] = { cardName: "Solo", lengths: [16,18,19], prefixes: [6334, 6767], checkdigit: true }; ccs["switch"] = { cardName: "Switch", lengths: [16,18,19], prefixes: [4903,4905,4911,4936,564182,633110,6333,6759], checkdigit: true }; ccs["maestro"] = { cardName: "Maestro", lengths: [12,13,14,15,16,18,19], prefixes: [5018,5020,5038,6304,6759,6761], checkdigit: true }; ccs["visaelectron"] = { cardName: "VisaElectron", lengths: [16], prefixes: [417500,4917,4913,4508,4844], checkdigit: true }; ccs["lasercard"] = { cardName: "LaserCard", lengths: [16,17,18,19], prefixes: [6304,6706,6771,6709], checkdigit: true }; return ccs[name.toLowerCase()]; }; var isValidCCNumber = function(name, number){ var cc = getCreditCard(name); var prefix = number.substring(0,1);//number.search(\b(?:3[47]\d|(?:4\d|5[1-5]|65|64)\d{2}|6011)\d{12}\b) //var isValidPrefix = cc.prefix == prefix; var isValidPrefix = false; for (var i = 0; i < cc.prefixes.length; i++) { if (number.startsWith(cc.prefixes[i])) { isValidPrefix = true; } } var isValidLength = cc.lengths.indexOf(number.length) != -1; return isValidPrefix && isValidLength; }; function disableCreditCardFields() { $("#cardName").removeClass("required"); $("#cardNum").removeClass().addClass("paid-input"); $("#expMonth").removeClass("required"); $("#expYear").removeClass("required"); $("#sCode").removeClass("required number"); $("#cardName").attr('disabled', 'disabled'); $("#cardName").val(''); $("#cardNum").attr('disabled', 'disabled'); $("#cardNum").val(''); $("#expMonth").attr('disabled', 'disabled'); $("#expMonth").val(''); $("#expYear").attr('disabled', 'disabled'); $("#expYear").val(''); $("#sCode").attr('disabled', 'disabled'); $("#sCode").val(''); $("#cardHolderName").attr('disabled', 'disabled'); $("#cardHolderName").val(''); $('#doCharge').val('False'); $('#BillingInformation_1_DoCharge').val('False'); $('#BillingInformation_1_ExpirationDate').val(''); $('#BillingInformation_1_ExpirationDate').attr('disabled', 'disabled'); $('#billingAmountPaid').val(''); $('#billingAmountPaid').attr('disabled', 'disabled'); $.each( ["#cardName","#cardNum","#expMonth","#expYear","#sCode"], function(i, element){ if($(element).length > 0){ $(element).valid(); } }); } function enableCreditCardFields() { $("#cardName").addClass("required"); $("#cardNum").addClass("required number"); $("#expMonth").addClass("required"); $("#expYear").addClass("required"); $("#sCode").addClass("required number"); $("#cardName").removeAttr('disabled'); $("#cardNum").removeAttr('disabled'); $("#expMonth").removeAttr('disabled'); $("#expYear").removeAttr('disabled'); $("#sCode").removeAttr('disabled'); $("#cardHolderName").removeAttr('disabled'); $('#doCharge').val('True'); $('#BillingInformation_1_DoCharge').val('True'); $('#billingAmountPaid').removeAttr('disabled'); $('#BillingInformation_1_ExpirationDate').removeAttr('disabled'); } function setBillingAddress() { $('#BillingInformation_1_NameOnCard').val($('input[name=FirstName]').val() + ' ' + $('input[name=LastName]').val()); $('#BillingInformation_1_BillingStreet').val($('input:text[name=Addresses_GROUP1_Street]').val()); $('#BillingInformation_1_BillingApartmentMailStop').val($('input:text[name=Addresses_GROUP1_ApartmentMailStop]').val()); $('#BillingInformation_1_BillingCity').val($('input:text[name=Addresses_GROUP1_City]').val()); $('#BillingInformation_1_BillingRegion').val($('#Addresses_GROUP1_RegionCode').val()); $('#BillingInformation_1_BillingPostalCode').val($('input:text[name=Addresses_GROUP1_PostalCode]').val()); $('#BillingInformation_1_BillingCountryCode').val($('#Addresses_GROUP1_CountryCode').val()); if($('#BillingInformation_1_NameOnCard').length) $('#BillingInformation_1_NameOnCard').valid(); if($('#BillingInformation_1_BillingStreet').length) $('#BillingInformation_1_BillingStreet').valid(); if($('#BillingInformation_1_BillingApartmentMailStop').length) $('#BillingInformation_1_BillingApartmentMailStop').valid(); if($('#BillingInformation_1_BillingCity').length) $('#BillingInformation_1_BillingCity').valid(); if($('#BillingInformation_1_BillingRegion').length) $('#BillingInformation_1_BillingRegion').valid(); if($('#BillingInformation_1_BillingPostalCode').length) $('#BillingInformation_1_BillingPostalCode').valid(); if($('#BillingInformation_1_BillingCountryCode').length) $('#BillingInformation_1_BillingCountryCode').valid(); } function clearBillingAddress() { var billingFields = []; billingFields.push($('#BillingInformation_1_NameOnCard')); billingFields.push($('#BillingInformation_1_BillingStreet')); billingFields.push($('#BillingInformation_1_BillingApartmentMailStop')); billingFields.push($('#BillingInformation_1_BillingCity')); billingFields.push($('#BillingInformation_1_BillingRegion')); billingFields.push($('#BillingInformation_1_BillingPostalCode')); billingFields.push($('#BillingInformation_1_BillingCountryCode')); for(var i = 0; i < billingFields.length; i++){ var billingField = billingFields[i]; billingField.val(''); if(billingField.size() > 0){ $(billingField).valid(); } } } function isBlank(value) { if (!value || value.length == 0) { return true; } return !/[^\s]+/.test(value); } function hasClass(element, cls) { return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; } function creditCardTypeValidation() { var creditTypeField = $('#BillingInformation_1_CreditCardType:checked'); if (creditTypeField.val()===undefined) creditTypeField = $('#BillingInformation_1_CreditCardType'); var creditCardField = $('#BillingInformation_1_CreditCardNumber'); var creditType = creditTypeField.val(); var creditCardNo = creditCardField.val(); $('#BillingInformation_1_CreditCardNumber').removeClass('creditcardall'); $('#BillingInformation_1_CreditCardNumber').removeClass('ccvisa'); $('#BillingInformation_1_CreditCardNumber').removeClass('ccmaster'); $('#BillingInformation_1_CreditCardNumber').removeClass('ccamex'); $('#BillingInformation_1_CreditCardNumber').removeClass('ccdiscover'); $('#BillingInformation_1_CreditCardNumber').removeClass('ccdinersclub'); $('#BillingInformation_1_CreditCardNumber').removeClass('creditcard'); if(!isBlank(creditCardNo)) { // 1 - Visa, 2 - MasterCard, 3 - Amex if(creditType == 1) { $('#BillingInformation_1_CreditCardNumber').addClass('ccvisa'); } else if(creditType == 2) { $('#BillingInformation_1_CreditCardNumber').addClass('ccmaster'); } else if(creditType == 3) { $('#BillingInformation_1_CreditCardNumber').addClass('ccamex'); } else if(creditType == 4) { $('#BillingInformation_1_CreditCardNumber').addClass('ccdiscover'); } else if(creditType == 5) { $('#BillingInformation_1_CreditCardNumber').addClass('ccdinersclub'); } $('#BillingInformation_1_CreditCardNumber').valid(); } } function scrollToErrorWithId(elementId){ var classesOnTermErrorLabel = $(elementId).attr("class").split(" "); for (var i=0; i<classesOnTermErrorLabel.length; i++){ if (classesOnTermErrorLabel[i]=="error" && $(elementId).html()!=""){ $('html, body').animate({ scrollTop: $(elementId).offset().top }, 75); } } } //for use with the non-responsive demo tag function manageNoneOfTheAboveMultiselect(elementClass, demoNOTAValueId, demoOtherName){ $(elementClass).bind('change click', function(){ if ($(this).val()==demoNOTAValueId){ $(elementClass).not(this).each(function(){ $(this).removeAttr("checked"); }); $(demoOtherName).attr('disabled','disabled').removeClass("required").val("").valid(); } else $(".noneOfTheAbove").removeAttr("checked"); }); } function limitedFormValidation(el) { var isValid = $(el).validate().checkForm(); // validate wo errors showing $(el).validate().submitted = {}; //then reset this functionality return isValid; } //make sure each button that should move you forward is of type=button and has the nextButton class /* implement by updating the form id, using: $('#paidform').on('keyup keypress', function(e) { enterTriggersFormShowHide(this,e); }); */ function enterTriggersFormShowHide(el,e){ var keyCode = e.keyCode || e.which; //if the enter key was pressed if (keyCode === 13){ var isValid=limitedFormValidation(el); //if the form is valid go to the next page instead of submitting if (isValid && !$("input[type=submit]").is(":visible")) { $(".nextButton:first:visible").trigger("click"); e.preventDefault(); } else { $("form").valid(); //if invalid valid to show the errors } } } function processRadioImageClick(sharedInputClass,thisInputId,sharedImgClass,thisImgId,uncheckedImgSrc,checkedImgSrc) { /*call this funct on load and pass it empty strings for the 2 Id vars in general the setup should be like: <label class="donation" onclick="processRadioImageClick('donationOption','donationOption1','radioImageBlueCircle','donationOption1image','/tfe/images/frwdCircleNoCheck.png','/tfe/images/frwdCircle.png');"> <span style="display: none;"> <input type="radio" name="donationOption" id="donationOption1" class="donationOption" value="18"> </span> <img src="/tfe/images/frwdCircleNoCheck.png" class="radioImageBlueCircle" id="donationOption1image">$18&nbsp; </label> */ $.each($("input."+sharedInputClass),function(){ $(this).removeAttr("checked"); }); $.each($("img."+sharedImgClass),function(){ $(this).attr("src",uncheckedImgSrc); }); if (thisInputId!="") { $("#"+thisImgId).attr("src",checkedImgSrc); $("#"+thisInputId).attr("checked",true); } } $(document).ready(function(){ //Enable and Clear Credit Card Fields for Bill Me $('#CreditCard').click(function () { $("#credit").show(); enableCreditCardFields(); updateBillingAmount(); }); $('#expMonth').change(function () { $('#expMonth').removeClass('ccexpiration-date'); $('#expMonth').addClass('ccexpiration-date'); if ($("#expYear").val() != "") $("#BillingInformation_1_ExpirationDate").val($("#expMonth").val() + $("#expYear").val()); $('#expMonth').valid(); }); $('#expYear').change(function () { $('#expYear').removeClass('ccexpiration-date'); $('#expYear').addClass('ccexpiration-date'); if ($("#expMonth").val() != "") $("#BillingInformation_1_ExpirationDate").val($("#expMonth").val() + $("#expYear").val()); $('#expYear').valid(); $('#expMonth').valid(); }); var ccNameField = $('#cardName'); var radioCCField = false; if($(ccNameField).length < 1){ ccNameField = $('.cardName'); radioCCField = true; } $(ccNameField).change(function () { var creditTypeField = $(ccNameField); if(radioCCField){ creditTypeField = $(".cardName:checked"); } var creditCardField = $('#cardNum'); var creditType = creditTypeField.val(); var creditCardNo = creditCardField.val(); $('#cardNum').removeClass('creditcardall'); $('#cardNum').removeClass('ccvisa'); $('#cardNum').removeClass('ccmaster'); $('#cardNum').removeClass('ccamex'); $('#cardNum').removeClass('ccdiscover'); $('#cardNum').removeClass('ccdinersclub'); $('#cardNum').removeClass('creditcard'); if(!isBlank(creditCardNo)) { // 1 - Visa, 2 - MasterCard, 3 - Amex, 4 - Discover, 5 - DinersClub if(creditType == 1) { $('#cardNum').addClass('ccvisa'); } else if(creditType == 2) { $('#cardNum').addClass('ccmaster'); } else if(creditType == 3) { $('#cardNum').addClass('ccamex'); } else if(creditType == 4) { $('#cardNum').addClass('ccdiscover'); } else if(creditType == 5) { $('#cardNum').addClass('ccdinersclub'); } $('#cardNum').valid(); } }); $('#cardNum').change(function () { var creditTypeField = $('#cardName'); if(radioCCField){ creditTypeField = $(".cardName:checked"); } var creditCardField = $('#cardNum'); var creditType = creditTypeField.val(); var creditCardNo = creditCardField.val(); if(!isBlank(creditCardNo) && creditType!=undefined) { // 1 - Visa, 2 - MasterCard, 3 - Amex, 4 - Discover, 5 - DinersClub if(creditType == 1) { $('#cardNum').addClass('ccvisa'); } else if(creditType == 2) { $('#cardNum').addClass('ccmaster'); } else if(creditType == 3) { $('#cardNum').addClass('ccamex'); } else if(creditType == 4) { $('#cardNum').addClass('ccdiscover'); } else if(creditType == 5) { $('#cardNum').addClass('ccdinersclub'); } $('#cardNum').valid(); } }); $('#cardNum').blur(function () { var creditTypeField = $('#cardName'); if(radioCCField){ creditTypeField = $(".cardName:checked"); } var creditCardField = $('#cardNum'); var creditType = creditTypeField.val(); var creditCardNo = creditCardField.val(); $('#cardNum').removeClass('creditcardall'); $('#cardNum').removeClass('ccvisa'); $('#cardNum').removeClass('ccmaster'); $('#cardNum').removeClass('ccamex'); $('#cardNum').removeClass('ccdiscover'); $('#cardNum').removeClass('ccdinersclub'); $('#cardNum').removeClass('creditcard'); if(!isBlank(creditType) && creditType!=undefined) { if(!isBlank(creditCardNo)) { // 1 - Visa, 2 - MasterCard, 3 - Amex, 4 - Discover, 5 - DinersClub if(creditType == 1) { $('#cardNum').addClass('ccvisa'); } else if(creditType == 2) { $('#cardNum').addClass('ccmaster'); } else if(creditType == 3) { $('#cardNum').addClass('ccamex'); } else if(creditType == 4) { $('#cardNum').addClass('ccdiscover'); } else if(creditType == 5) { $('#cardNum').addClass('ccdinersclub'); } $('#cardNum').valid(); } else { $('#cardNum').addClass('creditcard'); $('#cardNum').valid(); } } }); }); var termAndCountryValidationMessage = "This term is not available for the selected country."; if("".length > 0){ termAndCountryValidationMessage = ""; } /* if a term is chosen which has no price (amount), it is not valid so display an error */ $.validator.addMethod('validateTermAndCountry', function (value, element, param) { var countrySelected = $('#Addresses_GROUP1_CountryCode').val(); if($('#term1radio').is(':checked')){ if(countrySelected === "USA"){ if(true) return false; } else if (countrySelected === "CAN"){ if(true) return false; } else if(true) return false; } else if ($('#term2radio').is(':checked')){ if(countrySelected === "USA"){ if(true) return false; } else if (countrySelected === "CAN"){ if(true) return false; } else if(true) return false; } else if ($('#term3radio').is(':checked')){ if(countrySelected === "USA"){ if(true) return false; } else if (countrySelected === "CAN"){ if(true) return false; } else if(true) return false; } return true; },termAndCountryValidationMessage); $.validator.addMethod("promoPriceChoice", function(value, element) { var valid = false; var selectedPriceChoice = $(element).find(":selected"); if($(selectedPriceChoice).attr("data-ppc-geoLocation") && $(selectedPriceChoice).attr("data-ppc-regionCode")){ var geoLocation = $(selectedPriceChoice).attr("data-ppc-geoLocation"); var geoLocationValid = false; if(geoLocation === 1 && $("#Addresses_GROUP1_CountryCode").val() === "USA"){ geoLocationValid = true; } $(selectedPriceChoice).attr("data-ppc-regionCode"); } return valid; },"The selected term is not available for your Country/Region."); function updateBillingAmount(){ var country = $('#Addresses_GROUP1_CountryCode').val(); var requestedVersionName = 'Products_2_RequestedVersion'; var requestedVersion = $("input[name=" + requestedVersionName + "]").val(); <!-- if requested version is a visible input, get the value only of whichever one is checked --> if($("input[name=" + requestedVersionName + "]:checked").length > 0){ requestedVersion = $("input[name=" + requestedVersionName + "]:checked").val(); } if($('.term1radio').length || $('.term2radio').length || $('.term3radio').length){ <!-- TODO: check that amount exists before setting it? or do we trust validateTermAndCountry to do this for us? --> if(requestedVersion == "P" || requestedVersion == "B"){ if($('.term1radio').is(':checked')){ if(country === "USA") $('#billingAmount').val(''); else if (country === "CAN") $('#billingAmount').val(''); else $('#billingAmount').val(''); } else if ($('.term2radio').is(':checked')){ if(country === "USA") $('#billingAmount').val(''); else if (country === "CAN") $('#billingAmount').val(''); else $('#billingAmount').val(''); } else{ if(country === "USA") $('#billingAmount').val(''); else if (country === "CAN") $('#billingAmount').val(''); else $('#billingAmount').val(''); } } else if(requestedVersion == "D"){ if($('.term1radio').is(':checked')){ $('#billingAmount').val(''); } else if ($('.term2radio').is(':checked')){ $('#billingAmount').val(''); } else{ $('#billingAmount').val(''); } } } <!-- if no term radio buttons are available, it must be a static term.. so determine price based upon requested version / country instead --> else{ if(requestedVersion == "P" || requestedVersion == "B"){ if(country === "USA" && false){ $('#billingAmount').val(''); } else if(country === "CAN" && false){ $('#billingAmount').val(''); } else if(false){ $('#billingAmount').val(''); } } else if(requestedVersion == "D"){ if(false){ $('#billingAmount').val(''); } } } $('#billingAmountPaid').val($('#billingAmount').val()); } function addTaxToBillingAmount() { var total = parseFloat($("input[name=Products_2_SalesTax]").val()) + parseFloat($("input[name=Products_2_Amount]").val()); if(isNaN(total)){ return; } else{ total = total.toFixed(2); $("#total-amount-confirm").text("$" + total); $("input[name=totalPriceHolder]").val(total); //update total amount and amount paid to include tax $("input[name=Products_2_AmountPaid]").val(total); return total; } } function validateCardExpirationYear() { $('#expYear').removeClass('ccexpiration-date'); $('#expYear').addClass('ccexpiration-date'); if ($("#expMonth").val() != "") $("#BillingInformation_1_ExpirationDate").val($("#expMonth").val() + $("#expYear").val()); return $('#expYear').valid(); } function validateCardExpirationMonth() { $('#expYear').removeClass('ccexpiration-date'); $('#expMonth').removeClass('ccexpiration-date'); $('#expMonth').addClass('ccexpiration-date'); if ($("#expYear").val() != "") $("#BillingInformation_1_ExpirationDate").val($("#expMonth").val() + $("#expYear").val()); return $('#expMonth').valid(); } function validateTermOnChange(){ var termRadioButtons = $("input[name='Products_2_Term']"); var validate = false; $.each(termRadioButtons, function(index, element){ if($(element).is(':checked')){ validate = true; return false; } }); if(validate){ $("input[name='Products_2_Term']").valid(); } } function disableBilling(){ $(".creditCardField").val(""); $(".creditCardField").attr('disabled','disabled'); $('#BillingInformation_1_DoCharge').val('False'); <!-- TODO: may eventually need to be able to disable multiple products' amountPaid fields, see chen-paid-template.jsp same-named function as this and setTotalProductPriceElement().. --> $('input[name="Products_2_AmountPaid"]').attr('disabled', 'disabled'); $("#billMe").val(1); updateAutoRenewalText(); } function enableBilling(){ $(".creditCardField").removeAttr('disabled'); $('#BillingInformation_1_DoCharge').val('True'); <!-- TODO: may eventually need to be able to enable multiple products' amountPaid fields, see chen-paid-template.jsp same-named function as this and setTotalProductPriceElement().. --> $('input[name="Products_2_AmountPaid"]').removeAttr('disabled'); $("#billMe").val(0); updateAutoRenewalText(); } function updateAutoRenewalText(){ if ($("#billMe").val() != undefined) { if ($("#billMe").val() == 1) { $(".autoRenewalTextCreditcard").hide(); $(".autoRenewalTextBillme").show(); } else { $(".autoRenewalTextCreditcard").show(); $(".autoRenewalTextBillme").hide(); } } else { $(".autoRenewalTextCreditcard").show(); $(".autoRenewalTextBillme").hide(); } } //this function will set the value of [resultHolder] to the tax amount * amount once the API is done // note: use $(document).ajaxStop(function() {}); to retrieve and use results that are set with this function (see npdn-paid-gift-scripts.jspf for an example) function setSalesTax(resultHolder, amount, prodId, countryCode, regionCode, postalCode, customerId,term) { var tax = ""; if(!customerId){ customerId = 0; } //call tax-lookup.jsp to find the tax for the given product $.ajax({ type: "POST", url: "jsp/tax-lookup.jsp", data: {amount : amount, prodId: prodId, countryCode: countryCode, regionCode: regionCode, postalCode: postalCode, customerId: customerId, term:term}, success: function(data,status,xhr){ $("#sales-tax-confirm, #total-amount-confirm").removeClass("calculating"); tax = data.trim(); }, error: function(xhr, status, error){ //TODO: should we return null instead of "" for tax if error occurs? console.log("error calculating tax for function setSalesTax: " + xhr.status); }, complete: function(){ //set resultHolder to value $(resultHolder).val(tax); }, dataType: "html" }); } //this function will find sales tax based upon parameters by ajax call and set $("#sales-tax-confirm") to the tax found function findSalesTax( amount, prodId, countryCode, regionCode, postalCode, customerId,term) { //disable the submit/cancel buttons until the tax has been calculated $(".final-submit-button").attr("disabled","disabled"); $("#sales-tax-confirm, #total-amount-confirm").addClass("calculating"); i = 0; setInterval(function() { i = ++i % 4; $(".calculating").html("calculating"+Array(i+1).join(".")); }, 500); //clear out the current tax value $("#taxHolder").val(0); //call tax-lookup.jsp to find the tax for the given product if(!customerId){ customerId = 0; } $.ajax({ type: "POST", url: "jsp/tax-lookup.jsp", data: {amount : amount, prodId: prodId, countryCode: countryCode, regionCode: regionCode, postalCode: postalCode, customerId: customerId,term:term}, success: function(data,status,xhr){ $("#sales-tax-confirm, #total-amount-confirm").removeClass("calculating"); var tax = data.trim(); $("input[name=Products_2_SalesTax]").val(tax); if(tax == '0' || tax == '0.00'){ $(".sales-tax-confirm-section").hide(); } else{ //write tax amount on page and display it $("#sales-tax-confirm").text("$" + tax); $(".sales-tax-confirm-section").show(); } //update the total amount to include tax as displayed on the confirm 'page' addTaxToBillingAmount(); }, error: function(xhr, status, error){ console.log("error calculating tax: " + xhr.status); $("#sales-tax-confirm").text("Error calculating tax"); $("#total-amount-confirm").text(""); }, complete: function(){ //disable the submit/cancel buttons until the tax has been calculated $(".final-submit-button").removeAttr("disabled"); }, dataType: "html" }); } $(document).ready(function(){ $("#toggleBillingAddress").bind("change", function(){ if($(this).is(":checked")){ $("#billing-address-section").show(); $(".billing-address-field").val(""); $("#BillingInformation_1_BillingRegion").val("Select State/Province"); } else{ $("#billing-address-section").hide(); setBillingAddress(); } }); $("#toggleBillingAddress").change(); $('#setBillingInfo').change(function () { if ($("#setBillingInfo").is(":checked")) { setBillingAddress(); } else { clearBillingAddress(); } var billingCountryCodeValue = $('#BillingInformation_1_BillingCountryCode').val(); if(billingCountryCodeValue != 'USA' && billingCountryCodeValue != "CAN" && billingCountryCodeValue != "") $('#BillingInformation_1_BillingRegion').val('53'); validateRegionCountry('BillingInformation_1_BillingCountryCode', 'BillingInformation_1_BillingRegion'); validatePostalCode('BillingInformation_1_BillingCountryCode', 'BillingInformation_1_BillingPostalCode'); validateProvince('BillingInformation_1_BillingRegion', 'BillingInformation_1_BillingPostalCode'); }); $('#COUNTRY').bind('change', function() { validateTermOnChange(); }); $('#Addresses_GROUP1_CountryCode').bind('change keyup', function() { if($('#Addresses_GROUP1_RegionCode').is(':visible')&& $('#Addresses_GROUP1_RegionCode').length > 0){ validateRegionCountry('Addresses_GROUP1_CountryCode', 'Addresses_GROUP1_RegionCode'); validatePostalCode('Addresses_GROUP1_CountryCode', 'Addresses_GROUP1_PostalCode'); } validateAllPhone('Addresses_GROUP1_CountryCode', 'Phones_200_Number'); validateTermOnChange(); }); $('#BillingInformation_1_BillingCountryCode').bind('change keyup', function() { if($(this).val() != '' && $(this).val() != 'CAN' && $(this).val() != 'USA'){ $('#BillingInformation_1_BillingRegion').val('53'); } validateRegionCountry('BillingInformation_1_BillingCountryCode', 'BillingInformation_1_BillingRegion'); validatePostalCode('BillingInformation_1_BillingCountryCode', 'BillingInformation_1_BillingPostalCode'); validateProvince('BillingInformation_1_BillingRegion', 'BillingInformation_1_BillingPostalCode'); }); $('#BillingInformation_1_BillingRegion').change(function () { validateRegionCountry('BillingInformation_1_BillingCountryCode', 'BillingInformation_1_BillingRegion'); validateProvince('BillingInformation_1_BillingRegion', 'BillingInformation_1_BillingPostalCode'); }); $('#BillingInformation_1_BillingPostalCode').bind('change keyup', function () { validateProvince('BillingInformation_1_BillingRegion', 'BillingInformation_1_BillingPostalCode'); validatePostalCode('BillingInformation_1_BillingCountryCode', 'BillingInformation_1_BillingPostalCode'); }); $('#expMonth').change(function () { if ($('#expYear').val() != "") { validateCardExpirationMonth(); } }); $('#expYear').change(function () { if ($('#expMonth').val() != "") { validateCardExpirationYear(); } }); $("input[name='paymentTypeInput']").bind('change',function() { if ($("#setBillMe:checked").length > 0) disableBilling(); else enableBilling(); }); $("input[name='paymentTypeInput']").change(); $(".ccgeneric").bind("change keyup",function(){ var firstDigit = $(this).val().substring(0,1); //setCreditCardType(firstDigit); setCreditCardTypeUsingWholeNumber($(this).val()); }); <!-- sometimes a term radio button will imply a requested version when there is no requested version visible on the page--> <!-- these jquery bind functions will automatically set a hidden requested version based upon if an input with --> <!-- term-requesting-(version) class is checked --> var requestedVersionHiddenInput = $("input[name='Products_2_RequestedVersion'][type='hidden']"); $("input.term-requesting-P").bind('change', function(){ if($(this).is(":checked") && $(requestedVersionHiddenInput).length){ $(requestedVersionHiddenInput).val("P"); } }); $("input.term-requesting-P").change(); $("input.term-requesting-D").bind('change', function(){ if($(this).is(":checked") && $(requestedVersionHiddenInput).length){ $(requestedVersionHiddenInput).val("D"); } }); $("input.term-requesting-D").change(); $("input.term-requesting-B").bind('change', function(){ if($(this).is(":checked") && $(requestedVersionHiddenInput).length){ $(requestedVersionHiddenInput).val("B"); } }); $("input.term-requesting-B").change(); }); function maskCreditCardNumber(ccnum, maskCharacter){ //replace all but the last 4 characters of the credit card number var mask = ccnum.substring(0, ccnum.length-4); mask = mask.replace(/./gi, maskCharacter); var lastfour = ccnum.substring(ccnum.length-4); return mask + lastfour; } function setCreditCardType(firstDigit){ var ccTypeInput = $("input[name=BillingInformation_1_CreditCardType]"); var ccNumberInput = $("#cardNum"); if($(ccTypeInput).length > 0 && $(ccNumberInput).length > 0){ switch(firstDigit) { case "3": $(ccTypeInput).val("3"); $(ccNumberInput).removeClass("ccvisa ccmaster ccdiscover"); $(ccNumberInput).addClass("ccamex"); break; case "4": $(ccTypeInput).val("1"); $(ccNumberInput).removeClass("ccamex ccmaster ccdiscover"); $(ccNumberInput).addClass("ccvisa"); break; case "5": $(ccTypeInput).val("2"); $(ccNumberInput).removeClass("ccvisa ccamex ccdiscover"); $(ccNumberInput).addClass("ccmaster"); break; case "6": $(ccTypeInput).val("4"); $(ccNumberInput).removeClass("ccvisa ccamex ccmaster"); $(ccNumberInput).addClass("ccdiscover"); break; default: $(ccNumberInput).removeClass("ccamex ccmaster ccdiscover ccvisa"); $(ccNumberInput).addClass("ccgeneric"); $(ccTypeInput).val("1"); } } } function setCreditCardTypeUsingWholeNumber(ccNumber){ var ccTypeInput = $("input[name=BillingInformation_1_CreditCardType]"); var ccNumberInput = $("#cardNum"); var ccs = []; ccs["visa"] = { cardName: "Visa", lengths: [13,16], prefixes: [4], checkdigit: true, ccType: 1 }; ccs["master"] = { cardName: "Master", lengths: [16], prefixes: [51,52,53,54,55,22], checkdigit: true, ccType: 2 }; ccs["dinersclub"] = { cardName: "DinersClub", lengths: [14,16], prefixes: [305,36,38], checkdigit: true, ccType: 5 }; ccs["carteblanche"] = { cardName: "CarteBlanche", lengths: [14], prefixes: [300,301,302,303,304,305], checkdigit: true }; ccs["amex"] = { cardName: "AmEx", lengths: [15], prefixes: [34,37], checkdigit: true, ccType: 3 }; ccs["discover"] = { cardName: "Discover", lengths: [16], prefixes: [6011,622,64,65], checkdigit: true, ccType: 4 }; ccs["jcb"] = { cardName: "JCB", lengths: [16], prefixes: [35], checkdigit: true }; ccs["enroute"] = { cardName: "enRoute", lengths: [15], prefixes: [2014,2149], checkdigit: true }; ccs["solo"] = { cardName: "Solo", lengths: [16,18,19], prefixes: [6334, 6767], checkdigit: true }; ccs["switch"] = { cardName: "Switch", lengths: [16,18,19], prefixes: [4903,4905,4911,4936,564182,633110,6333,6759], checkdigit: true }; ccs["maestro"] = { cardName: "Maestro", lengths: [12,13,14,15,16,18,19], prefixes: [5018,5020,5038,6304,6759,6761], checkdigit: true }; ccs["visaelectron"] = { cardName: "VisaElectron", lengths: [16], prefixes: [417500,4917,4913,4508,4844], checkdigit: true }; ccs["lasercard"] = { cardName: "LaserCard", lengths: [16,17,18,19], prefixes: [6304,6706,6771,6709], checkdigit: true }; var foundcc = null; if($(ccTypeInput).length > 0 && $(ccNumberInput).length > 0){ for (var ccName in ccs) { var cc = ccs[ccName]; $(ccNumberInput).removeClass("cc"+cc.cardName.toLowerCase()); for (var i = 0; i < cc.prefixes.length; i++) { if (ccNumber.startsWith(""+cc.prefixes[i])) { foundcc = cc; } } } if (foundcc != undefined) { $(ccTypeInput).val(foundcc.ccType); $(ccNumberInput).addClass("cc"+foundcc.cardName.toLowerCase()); } else { $(ccNumberInput).addClass("ccgeneric"); $(ccTypeInput).val("1"); } } } function removeOECPrefixFromDemos(){ var oecDemos = $('input[name^="OEC_"]'); $.each(oecDemos, function(index, demoInput){ $(demoInput).prop("name", $(demoInput).prop("name").replace('OEC_','')); }); oecDemos = $('select[name^="OEC_"]'); $.each(oecDemos, function(index, demoInput){ $(demoInput).prop("name", $(demoInput).prop("name").replace('OEC_','')); }); } function toggleWriteInDesc(element){ var demoName = $(element).prop('name'); var writeInContainer = $(element).closest("div").find(".demo-other-input-container").not(".do-not-toggle"); var demoNameWithValue=demoName; if((demoName.indexOf("OEC_") < 0 && (demoName && demoName.split("_").length > 4))){ demoNameWithValue = demoName; demoName = demoName.replace("_" + demoName.split("_")[4], "").replace("_" + demoName.split("_")[3], ""); } else if((demoName.indexOf("OEC_") < 0 && (demoName && demoName.split("_").length > 3))){ demoNameWithValue = demoName; demoName = demoName.replace("_" + demoName.split("_")[3], ""); } else if(demoName.indexOf("OEC_") > -1 && (demoName && demoName.split("_").length > 4)){ demoNameWithValue = demoName; demoName = demoName.replace("_" + demoName.split("_")[4], ""); } var writeInDescName = demoName.replace("OEC_","") + '_WriteInDesc'; var writeInDesc = $("input[type='text'][name='" + writeInDescName + "']"); if(!writeInDesc.length){ writeInDesc = writeInContainer.find("input[name^='Demographic_'][type='text']"); } if(!writeInDesc.length){ return; } if($(element).is("select")){ if($(element).find(":selected").length && $(element).find(":selected").hasClass("demographic-other-value")){ $(writeInDesc).removeAttr("disabled"); $(writeInDesc).addClass("required"); $(writeInContainer).show(); } else{ $(writeInContainer).hide(); $(writeInDesc).prop("disabled","disabled"); $(writeInDesc).removeClass("required"); $(writeInDesc).val(""); } } else{ if($(element).hasClass('demographic-other-value')){ if($(element).is(":checked")){ writeInDesc.removeAttr("disabled"); $(writeInDesc).addClass("required"); $(writeInDesc).parent().show(); } else{ $(writeInDesc).prop("disabled","disabled"); $(writeInDesc).removeClass("required"); $(writeInDesc).val(""); if (demoNameWithValue!=undefined && demoNameWithValue.split("_")[4]=="RESPONSE" && demoNameWithValue.split("_")[3]=="MULTI") $(writeInDesc).parent().hide(); } } if(!$("input[name^='" + demoName + "'].demographic-other-value").is(":checked") && ( (demoNameWithValue && $("input[name^='" + demoNameWithValue + "'].demographic-other-value").length && !$("input[name^='" + demoNameWithValue + "'].demographic-other-value").is(":checked")) || ($(element).attr("type") == "radio") ) ){ $(writeInDesc).prop("disabled","disabled"); $(writeInDesc).removeClass("required"); $(writeInDesc).val(""); } else if($("input[name^='" + demoName + "'].demographic-other-value").is(":checked") && ( (demoNameWithValue && $("input[name^='" + demoNameWithValue + "'].demographic-other-value").length && $("input[name^='" + demoNameWithValue + "'].demographic-other-value").is(":checked")) || ($(element).attr("type") == "radio") ) ){ $(writeInDesc).prop("disabled",false); $(writeInDesc).addClass("required"); } } } function getCheckboxDemoClassName(checkbox){ var checkboxDemoClassName; $.each($(checkbox).prop("class").split(' '), function(index, className){ if(className.indexOf('checkboxDemo-') == 0){ checkboxDemoClassName = className; return true; } }); return checkboxDemoClassName; } function getClassNameByPrefix(element, prefix){ var returnClassName; $.each($(element).prop("class").split(' '), function(index, className){ if(className.indexOf(prefix) == 0){ returnClassName = className; return true; } }); return returnClassName; } function toggleNoneOfTheAbove(checkbox){ if($(checkbox).is(":checked")){ var className = getCheckboxDemoClassName(checkbox); if(!className){ return; } if($(checkbox).hasClass("noneOfTheAbove")){ $("input." + className + ":checkbox").not(".noneOfTheAbove").removeAttr("checked"); var otherCheckbox = $("input.demographic-other-value." + className + ":checkbox").not(".noneOfTheAbove"); if(otherCheckbox.length > 0){ $(otherCheckbox).change(); } } else{ $("input." + className + ".noneOfTheAbove:checkbox").removeAttr("checked"); } } } function toggleNoneOfTheAboveMultiselect(value){ if($(value).is(":selected") || $(value).is(":checked")){ var className = getCheckboxDemoClassName(value); if(!className){ return; } if($(value).hasClass("noneOfTheAbove")){ $("." + className).not(".noneOfTheAbove").prop("selected",false); $("." + className).not(".noneOfTheAbove").removeAttr("checked"); } else{ $("." + className + ".noneOfTheAbove").prop("selected",false); $("." + className + ".noneOfTheAbove").removeAttr("checked"); } } } function isOneCheckedByClass(className){ return $("input." + className + ":checked").length; } function setCASLDemoValue(){ var CASLDemoName = ""; if(CASLDemoName.length > 0){ var caslDemographic = $('input[type="hidden"][name=""]'); var country = $('select[name="Addresses_GROUP1_CountryCode"]').val(); if ($('input[class*="thirdParty"]').is(":checked") && country == "CAN") caslDemographic.val(""); else caslDemographic.val(''); } } $(document).ready(function(){ $("[name$='_WriteInDesc']").prop("disabled","disabled"); $.each($("select[name^='Demographic_'], input[name^='Demographic_'][type='checkbox'], input[name^='Demographic_'][type='radio'], [name^=CONSOL_][class*=demographic]"), function(index, value){ $(value).bind("change", function(){ toggleWriteInDesc(value); }); if(!$(value).hasClass('demographic-other-value')){ $(value).change(); } }); $.each($("select[name^='OEC_Demographic_'], input[name^='OEC_Demographic_'][type='checkbox'], input[name^='OEC_Demographic_'][type='radio']"), function(index, value){ $(value).bind("change", function(){ toggleWriteInDesc(value); }); if(!$(value).hasClass('demographic-other-value')){ $(value).change(); } }); $.each($("input.noneOfTheAbove:checkbox"), function(index,checkbox){ var className = getCheckboxDemoClassName(checkbox); if(!className){ return; } $.each($("input." + className + ":checkbox"), function(index, checkbox2){ $(checkbox2).bind("change", function(){ toggleNoneOfTheAbove(checkbox2); }); }); }); $.each($("select.multi-select"), function(index,element){ $(element).bind("change",function(){ var allSelectedOptions = $("#" + this.id + " option:selected"); if($(allSelectedOptions).hasClass("noneOfTheAbove")){ $(allSelectedOptions).not(".noneOfTheAbove").prop("selected",false); $(allSelectedOptions).not(".noneOfTheAbove").removeAttr("checked"); } }); }); $.each($("input[class*='multiResponse-'][type='checkbox']"), function(index,element){ $(element).bind("change",function(){ var className = getClassNameByPrefix(element, 'multiResponse-'); if($(".multiResponseRequired." + className).length > 0){ $(".multiResponseRequired." + className).valid(); } }); }); $.validator.addMethod('isOneSelected', function (value, element, param) { return isOneCheckedByClass(getCheckboxDemoClassName(element)); },"Please specify."); $.validator.addMethod("multiResponseRequired", function(value, element) { return isOneCheckedByClass(getClassNameByPrefix(element, 'multiResponse-')); },"Please select at least one option."); }); function findDemographic(demoName, valueId){ var field = $('[name="' + demoName + '"]'); if(!$(field).length || $('[name="' + demoName + '"][value="' + valueId + '"]').length ){ field = $('[name="' + demoName + '"][value="' + valueId + '"]'); } if(!$(field).length){ demoName += "_" + valueId; field = $('[name="' + demoName + '"]'); } return field; } function populateDemographic(demographicId, valueId, writeInDesc, valueText){ var demoName = "Demographic_SPCD_" + demographicId; var field = findDemographic(demoName, valueId); var skipDemo = $(findDemographic(demoName+"_MULTI_RESPONSE", valueId)).hasClass("skip-prePop"); if (~valueText.indexOf("&"+"quot;")) valueText=valueText.replace(/&quot;/g,"\""); if(isMultiselectDemo(demoName, field, valueId) && !skipDemo){ populateMultiselectDemographic(demoName, valueId); } else if(!$(field).length){ demoName = "OEC_Demographic_SPCD_" + demographicId; field = findDemographic(demoName, valueId); } if(field && $(field).length && !skipDemo){ var type = $(field).prop("type"); if(!type && $(field).is("select")){ type = "select"; } if(type == "radio" || type == "checkbox"){ if(!field.prop('checked') && field.val() === valueId){ field.prop('checked', true); field.change(); } } else if(type == "select" || type == "select-one" || type == "hidden"){ if(valueText && valueText != "" && field.val() != valueText){ field.val(valueText); field.change(); } else if(valueId && valueId != "" && ($.type(valueId) === "string" && valueId.toLowerCase() != "null") && field.val() != valueId){ field.val(valueId); field.change(); } } else if(type == "text"){ if(field.val() != valueText){ field.val(valueText); field.change(); } } if(writeInDesc && writeInDesc.length > 0){ var textField = $('input[name="Demographic_SPCD_' + demographicId + '_WriteInDesc"]'); if(!$(textField).length){ textField = $('input[name="OEC_Demographic_SPCD_' + demographicId + '_WriteInDesc"]'); } if (textField.prop("disabled") == "disabled"){ textField.parent().show().css("display", "inline-block") textField.removeAttr("disabled"); textField.addClass("required"); } textField.val(writeInDesc); textField.change(); } } } function isMultiselectDemo(demoName, field, valueId){ demoName = demoName + "_MULTI_RESPONSE"; field = findDemographic(demoName, valueId); if(field && $(field).length > 0){ return true; } else{ return false; } } function populateMultiselectDemographic(demoName, valueId, writeInDesc, valueText){ demoName = demoName + "_MULTI_RESPONSE"; var field = $("select[name=" + demoName + "]"); if($.fn.multiselect && $(field).length > 0){ $(field).multiselect('select',valueId); } else { $("input:checkbox[name=" + demoName + "][value=" + valueId + "]").attr("checked", "checked"); } } function bindCheckboxGroupDemo(multiSelect, noneOfTheAboveValue){ $("input:checkbox[name='" + multiSelect + "']").on( "click", function() { var foundNone = false; var element = this; if (noneOfTheAboveValue !== undefined) { if ($(element).val() == noneOfTheAboveValue) { foundNone = true; if ($(element).is(':checked')) { $.each($("input:checkbox[name='" + multiSelect + "']"), function(index,item){ if ($(item).val() != $(element).val()) { $(item).removeAttr("checked"); } }); } } else { $("input:checkbox[value='" + noneOfTheAboveValue + "']").removeAttr("checked"); } } if (!foundNone) { var writeInDescContainer = $(element).parent().parent().parent().find("div.demo-other-input-container"); if($(element).hasClass("demographic-other-value")) { if($(element).is(':checked')) { $(writeInDescContainer).show(); $(writeInDescContainer).find("input").prop("disabled",false).addClass("required");//enable the write in description textbox } else { $(writeInDescContainer).hide(); } } } }); } //this function relies on bootstrap-multiselect.js and bootstrap-multiselect.css as well as including bootstrap and its dependencies function bindJqueryMultiselect(multiSelect, noneOfTheAboveValue){ if(!multiSelect){ return false; } if($.fn.multiselect){ $(multiSelect).multiselect({ numberDisplayed: 1,//only display text of 1 option if it's selected, otherwise say "2 selected", etc buttonContainer: '<div class="bootstrap-multiselect-btn btn-group" />', onChange: function(element, checked){ if(checked === true && $(element).val() === noneOfTheAboveValue && noneOfTheAboveValue !== "") {//if "none of the above" is selected, clear all other values $(multiSelect).multiselect("deselectAll",false);//unselect all options $(multiSelect).multiselect('select', [noneOfTheAboveValue]);//reselect "none of the above" } else if(checked === true && noneOfTheAboveValue !== ""){ $(multiSelect).multiselect('deselect', [noneOfTheAboveValue]);//deselect "none of the above" if any non-noneOfTheAbove option is selected } if($(element).hasClass("checkAllOfTheAbove")) { if (checked === true) { $.each($(multiSelect).find("option"), function(index,elementOption){ $(multiSelect).multiselect('select', $(elementOption).val()); }); $.each($(multiSelect).next().find("input"), function(index,elementInput){ if ($(elementInput).val() != "") { $(elementInput).change(); } }); $(multiSelect).multiselect('select', ''); } else { $.each($(multiSelect).find("option"), function(index,elementOption){ $(multiSelect).multiselect('deselect', $(elementOption).val()); }); $.each($(multiSelect).next().find("input"), function(index,elementInput){ if ($(elementInput).val() != "") { $(elementInput).change(); } }); $(multiSelect).multiselect('deselect', ''); } } else { //check if there is a checkAllOfTheAbove on this multiselect, and uncheck it if ($(element).parent().find(".checkAllOfTheAbove").html() !== undefined) { $(multiSelect).multiselect('deselect', '');//deselect "check all of the above" } } var writeInDescContainer = $(element).closest("label").closest("div").find("div.demo-other-input-container"); if(checked === true && $(element).hasClass("demographic-other-value")) { $(writeInDescContainer).show(); $(writeInDescContainer).find("input").prop("disabled",false).addClass("required").val("");//enable the write in description textbox } else if(!$(multiSelect).find(":selected").hasClass("demographic-other-value")){ $(writeInDescContainer).val("").hide(); } if($(multiSelect).find(":selected").length > 0){ $(multiSelect).valid(); } } }); } } function initializeDemographics() { } /** * clear * @param productReceive */ function productReceiveHidden(productReceive) { var input = $("#" + productReceive.id.substr(8)); if(productReceive.checked) { input.val("1"); } else { input.val(input.attr("originalvalue") != "" && input.attr("originalvalue") != undefined ? "0" : ""); } } /** * set the value and originalValue of a product checkbox so that it will be opted in/out of correctly when the form submits * @param nlet */ function nletClicked(nlet) { var input = $("#" + nlet.id.substr(4)); if(nlet.checked) { input.val("1"); } else { input.val(input.attr("originalvalue") != "" && input.attr("originalvalue") != undefined ? "0" : ""); } } /** * some pages we want to record opt out when checked */ function nletClickedReversed(nlet) { var input = $("#" + nlet.id.substr(4)); if(nlet.checked) { input.val("0"); } else { input.val(input.attr("originalvalue") != "" && input.attr("originalvalue") != undefined ? "1" : ""); } } /** * CASL law requires us to not pre-populate checkboxes which opt a user into deployments if the user has selected Canada as their country * this function will uncheck all checkboxes created with the naming convention in optionalProductCheckbox.tag (box_Product_1_Receive for example) * @param countryDropdown * @param inputs - optional list of inputs to provide, by default inputs beginning with id 'box_' will be used * @param radioFlag - if 'true', unselect radio options with class "nletYes" for optional products */ //if using radios make sure the radio (or at least the yes option) has class nletYes function caslCountryChanged(countryDropdown, inputs, radioFlag){ var encryptedCustomerId = ""; if(encryptedCustomerId.length < 1 || $(countryDropdown).hasClass("changed")){ var countrySelected = $(countryDropdown).val(); var productInputs = []; if(inputs){ productInputs = inputs; } else if (radioFlag) { productInputs = $("input[type='radio'][name^='Products_'].nletYes"); } else{ productInputs = $("input[type='checkbox'][id^='box_']"); } if(productInputs){ var region = $('#Addresses_GROUP1_CountryCode option:selected').attr('region'); if(countrySelected == "CAN" || region == "EU"){ $.each(productInputs,function(index, value){ $(value).removeAttr("checked"); nletClicked(this); }); } else{ $.each(productInputs,function(index, value){ $(value).prop("checked", "checked"); nletClicked(this); }); $(productInputs).prop("checked", "checked"); } } } } function validateRecipientEmailAddresses() { var counter = 0; recipientEmailList = $("#recipientEmail").val().split(","); for(var index=0;index<recipientEmailList.length;index++) { if(!isValidEmailAddress(recipientEmailList[index])) { counter++; } } if(counter > 0) { return false; } return true; } function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); return pattern.test(emailAddress); } function findUsername(username) { //only begin a username lookup if one is not already in progress if($("#usernameLookupStatus").val() !== "2" && (username && username.length > 0)){ //set hidden usernameLookupStatus input // 0 for incomplete/invalid, 1 for success, 2 for in progress $("#usernameLookupStatus").val(2); //call username-lookup.jsp to see if the username entered is currently taken $.ajax({ type: "POST", url: "jsp/username-lookup.jsp", data: {u : username}, success: function(data,status,xhr){ var responseText = data.trim(); $("#userNameResponse").html(responseText); //TODO: update username-lookup.jsp to return the returnCode instead of a string message so that it is easier to interpret here if(responseText.indexOf("unavailable") > 0 || responseText.indexOf("already exists") > 0){ $("#usernameLookupStatus").val(0); } else{ $("#usernameLookupStatus").val(1); } }, error: function(xhr, status, error){ $("#usernameLookupStatus").val(0); }, complete: function(){ $("input[type=submit]").removeAttr("disabled"); }, dataType: "html" }); } } function isUsernameAvailable(form, usernameInput){ var isAvailable = true; if($(form).valid()){ //if userName input has anything entered into it, make sure that the ajax call has finished successfully before // allowing the user to 'continue' to submit if($(usernameInput).length > 0 && $(usernameInput).val().length > 0){ var usernameLookupStatus = $("#usernameLookupStatus").val(); if(usernameLookupStatus == "0" || usernameLookupStatus == ""){ //if username is taken or lookup never happened, focus the userName input $(usernameInput).focus(); isAvailable = false; } else if(usernameLookupStatus == "2"){ //if username lookup is still in progress, alert the user (this probably won't happen often..) alert("A Username lookup is currently in progress - please wait a moment while we determine if the username you entered is available."); isAvailable = false; } } } return isAvailable; } function markPostalCodeAsRequired(countryCode, postalCode) { var country = $("#" + countryCode); if(country) { if(country.val() == "USA" || country.val() == "CAN") { $("." + postalCode + "_required-asterisk").show(); } else{ $("." + postalCode + "_required-asterisk").hide(); } } } function toggleShippingPostalCodeRequiredAsterisk(){ var countrySelected = $(".shippingCountryCode").val(); var postalCodeRequiredAsterisk = $(".shippingPostalCodeRequiredAsterisk"); if(countrySelected && (countrySelected === "USA" || countrySelected === "CAN" || countrySelected === "")){ postalCodeRequiredAsterisk.show(); } else{ postalCodeRequiredAsterisk.hide(); } } function showHidePpcsBasedOnVersion(){ if("Products_2_RequestedVersion" !== "" && $(".promo-price-button").length > 0){ var requestedVersion = $("input[name=Products_2_RequestedVersion]:checked").val(); $("[id^=buttonPrice_][id$=__D]").hide(); $("[id^=buttonPrice_][id$=__D]").find("label.promo-price-button").removeClass("active").find("input").prop("checked",false); $("[id^=buttonPrice_][id$=__P]").hide(); $("[id^=buttonPrice_][id$=__P]").find("label.promo-price-button").removeClass("active").find("input").prop("checked",false); $("[id^=buttonPrice_][id$=__B]").hide(); $("[id^=buttonPrice_][id$=__B]").find("label.promo-price-button").removeClass("active").find("input").prop("checked",false); $("[id^=buttonPrice_][id$=__" + requestedVersion + "]").show(); } } /** * hide requested version buttons if no product price codes correspond to them and if product price codes are being used */ function hideUnusedRequestedVersionButtons(){ if($(".promo-price-button").length > 0 && "{2=com.omeda.api.cache.promotion.PromotionProductCache@72994102}" !== ""){ if($("[id^=buttonPrice_][id$=__D]").length === 0){ $("#requested-version-button-D").hide(); $("#requested-version-button-D").find("input").prop("checked",false); } if($("[id^=buttonPrice_][id$=__P]").length === 0){ $("#requested-version-button-P").hide(); $("#requested-version-button-P").find("input").prop("checked",false); } if($("[id^=buttonPrice_][id$=__B]").length === 0){ $("#requested-version-button-B").hide(); $("#requested-version-button-B").find("input").prop("checked",false); } } } function findPassalongClassForElement(element){ var passalongClass = ''; $.each($(element).attr("class").split(" "), function(index, value){ //passalong class will be PG01, or PG02, etc and all fields in passalong section should have this class if (value.indexOf('PG') == 0) { passalongClass = value; } }); return passalongClass; } /** * enable or disable passalong product checkboxes based on what products are selected to be received and what country is selected if any */ function togglePassalongProductsEnabled(){ $.each($(".consol-receive:checked"),function(index, element){ //enable or disable the passalong product checkboxes corresponding to each checked consol product var passalongProductId = $(element).attr("data-pg-product"); if(passalongProductId && passalongProductId.length > 0){ var passalongProduct = $(".pg-product[data-pg-product=" + passalongProductId + "]"); var passalongCountrySelected = $(passalongProduct).closest("div.passalong-field-container").find(".passalongCountry").val(); if($(element).val() === "0" || (passalongCountrySelected === "CAN" && $(passalongProduct).hasClass("digital-only"))){ $(passalongProduct).prop("disabled",true).prop("checked",false).closest("div.checkbox").addClass("disabled"); } else{ $(passalongProduct).prop("disabled",false).closest("div.checkbox").removeClass("disabled"); } } }); } function toggleConsolForeignDigitalProducts(countryCode, versionPrepopValue){ if(countryCode === "USA"){ //only show the receive options for consol products that have receive 'yes' checked var consolProductContainers = $(".consol-receive[value=1]:checked").closest(".consol-product-container"); $(consolProductContainers).find(".foreign-digital-only").show(); $(".foreign-digital-text").hide(); if(versionPrepopValue && $(consolProductContainers).find(".consol-requested-version[value=" + versionPrepopValue + "]").length > 0){ $(".consol-product-container .receive-version-button").removeClass("active"); $(consolProductContainers).find(".consol-requested-version").prop("checked",false);//uncheck all requested version buttons $(consolProductContainers).find(".consol-requested-version[value=" + versionPrepopValue + "]").prop("checked",true).closest(".receive-version-button").addClass("active"); } } else{ $(".foreign-digital-only").hide(); $(".foreign-digital-text").show(); $(".consol-product-container .receive-version-button").removeClass("active"); $(".consol-product-container input.fd-only[value=D]").closest(".receive-version-button").addClass("active"); $(".consol-product-container input.fd-only").prop("checked",false);//uncheck all requested versions $(".consol-product-container input.fd-only[value=D]").prop("checked",true).change();//re-check digital } if(countryCode === "" && $("#COUNTRY").val() === ""){ $(".foreign-digital-text").hide(); } } //see encrypted-validation-string-inputs.jspf function toggleEncryptedHiddenInputValues(switchValid){ $("#abi1e").prop("disabled",!switchValid); $("#abi2d").prop("disabled",switchValid); } $(document).ready(function(){ /** * only display the required asterisk for postal code for shipping address if country is not selected or is USA or Canada (based on class names) */ $(".shippingCountryCode").bind("change",function(){ toggleShippingPostalCodeRequiredAsterisk(); }); /** * "forward to a friend" * if recipientEmail is present, bind a blur function to it that will validate a comma-separated list of emails */ $("#recipientEmail").blur(function() { if(!validateRecipientEmailAddresses()) { $("#recipientEmail").addClass("email"); } else { $("#recipientEmail").removeClass("email"); } }); /** * if any passalong fields are filled out, make the rest of that passalong field group required */ $('.passalongField').change(function() { var passalongGroup = ""; $.each($(this).prop('class').split(' '), function(index, item) { if (item.indexOf('PG') == 0) { passalongGroup = item.substring(2); } }); if (passalongGroup != "") { var isEmpty = true; $.each($('.PG' + passalongGroup).not(".pg-product"), function(index, item) { if (item != null && $(item).val() != "") { isEmpty = false; } }); if (isEmpty) { $('.PG' + passalongGroup).removeClass('required'); } else { $('.PG' + passalongGroup).not(".pg-product").not(":disabled").addClass('required'); } } }); /** * same idea as passalong function above... require all fields sharing optionalFieldGroup class if any are filled out */ $('.optionalFieldGroup').change(function() { var isEmpty = true; $.each($('.optionalFieldGroup'), function(index, item) { if (item !== null && $(item).val() !== "") { isEmpty = false; return false; } }); if (isEmpty) { $('.optionalFieldGroup').removeClass('required'); } else { $('.optionalFieldGroup').addClass('required'); } }); /** * same idea as passalong function above... require all fields sharing optionalFieldGroup_# class if any are filled out */ $("[class*=optionalFieldGroup]").change(function() { var className = 'optionalFieldGroup'; var groupNumber = findClassContainingString($(this), 'optionalFieldGroup').split('_')[1]; if(groupNumber){ className += '_' + groupNumber; } var isEmpty = true; $.each($('.' + className), function(index, item) { if (item !== null && $(item).val() !== "") { isEmpty = false; return false; } }); if (isEmpty) { $('.' + className).removeClass('required'); } else { $('.' + className).addClass('required'); } }); function findClassContainingString(element, stringToSearchFor){ var classToReturn = ''; $.each($(element).attr("class").split(" "), function(index, value){ if (value.indexOf(stringToSearchFor) >= 0) { classToReturn = value; } }); return classToReturn; } var isAuthRequired = false; if(typeof authRequired !== 'undefined'){ isAuthRequired = authRequired; } if(!isAuthRequired || (isAuthRequired && isAuthRequired == "false")){ $('.auth-input-field').bind('change keyup', function(){ var isRequired = false; var hasRequiredClass = false; /* if any auth input field is populated, make them all required */ $.each($('.auth-input-field'), function(index, value){ if(!hasRequiredClass && $(value).hasClass('required')){ hasRequiredClass = true; } if($(value).val() && $(value).val() != ''){ isRequired = true; return false; } }); /* if any auth fields are filled out, set required class for other auth textboxes */ if(isRequired){ if(!hasRequiredClass){ $(".auth-input-field").addClass("required"); } } else{ $(".auth-input-field").removeClass("required"); } }); $(".auth-input-field").change(); } else{ $("input[name=userName]").addClass("required"); $("input[name=password]").addClass("required"); $(".auth-asterisk").show(); } }); function setOptions(select, options) { select.empty(); select.append('<option value="">Select One</option>'); for(var i = 0; i < options.length; i++) { var option = options[i]; select.append('<option value="' + option.id + '">' + option.name + '</option>'); } } function isOneCheckedByClass(className){ return $("input." + className + ":checked").length > 0; } function setProductsSubmitted(productsSubmittedConstant){ var productsSubmitted = ""; if(!productsSubmittedConstant || (productsSubmittedConstant && productsSubmittedConstant.length < 1)){ productsSubmittedConstant = "productsSubmitted"; } var productsSubmittedInput = $("input[name=" + productsSubmittedConstant + "]"); if($(productsSubmittedInput).length > 0){ //clear the hidden input $(productsSubmittedInput).val(""); var productCheckboxes; var magazineCheckboxes = $("input[name^='Products_'][name$='_Receive'][value!=''][disabled!='disabled']:checked"); var isFirst = true; //get all checked newsletter checkboxes var nletCheckboxes = $("input[name^='Products_'][name$='_Receive'][type='hidden'][value!=''][disabled!='disabled']"); productCheckboxes = $.merge(magazineCheckboxes,nletCheckboxes); var productIds = []; for (i = 0; i < productCheckboxes.length; i++) { //$.each(productCheckboxes, function( i, value ){ IE7 does not support .each var value = productCheckboxes[i]; if(value.name.split("_").length >= 2){ //if the nlet is being opted out of but the user does not have the nlet yet, skip if(value.getAttribute("originalvalue") != null && value.getAttribute("originalvalue") === undefined && value.value == "0"){ //.hasAttribute not supported in IE7 continue; } //pull the product id from Products_##_Receive var productId = value.name.split("_")[1]; //if this product id has already been added OR there is no optin/out value, continue if($.inArray(productId,productIds) > -1 || value.value==""){ continue; } productIds.push(productId); if(isFirst){ if(productsSubmitted != ""){ productsSubmitted += ","; } productsSubmitted += productId; isFirst = false; } else{ productsSubmitted += "," + productId; } } } $(productsSubmittedInput).val(productsSubmitted); } } /** * countrySelected should be either "USA", "CAN", or an international country * we will use the country selected to determine which states should be hidden/shown in the state dropdown * @param countrySelected * @param stateDropdown - select element for state options.. this is needed so that we can de-select an option that becomes hidden if it was selected */ function updateStateOptions(countrySelected, stateDropdown){ //hide all states, then display only the ones which correspond to the country selected $("option.USA-state, option.CAN-state, option.INT-state").hide(); var stateClass = "stateClass";//using a filler className so that the option.stateClass selector does not have an error ("option.") if no country is selected if(countrySelected === ""){ //if no country was selected, show all state options if (stateDropdown.hasClass("giftShippingStateSelect")) $("option.USA-state-gift, option.CAN-state-gift, option.INT-state-gift").show(); else $("option.USA-state, option.CAN-state, option.INT-state").show(); } else if(countrySelected === "USA"){ if (stateDropdown.hasClass("giftShippingStateSelect")) stateClass = "USA-state-gift"; else stateClass = "USA-state"; } else if(countrySelected === "CAN"){ if (stateDropdown.hasClass("giftShippingStateSelect")) stateClass = "CAN-state-gift"; else stateClass = "CAN-state"; } else{ if (stateDropdown.hasClass("giftShippingStateSelect")) stateClass = "INT-state-gift"; else stateClass = "INT-state"; $(stateDropdown).val("53"); } $("option." + stateClass).show(); //if currently selected state does NOT have the class associated with the country selected, de-select it if(!$($(stateDropdown).find(":selected")).hasClass(stateClass)){ $(stateDropdown).val(""); } } function disablePassalongFields(){ $("#passalong-section").hide(); $(".passalongField").prop("disabled",true); } function enablePassalongFields(){ var requestedVersion = ""; var enableDigitalPassalong = false; if("Products_2_RequestedVersion" !== ""){ requestedVersion = $("input[name=Products_2_RequestedVersion]:checked").val(); enableDigitalPassalong = $("input[name=Products_2_RequestedVersion]").hasClass("enable-digital-passalong"); } //only re-enable passalong fields if digital is not also selected if(requestedVersion !== "D" || enableDigitalPassalong){ $(".passalongField").prop("disabled",false); $("#passalong-section").show(); } } function isIE() { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) return true; else return false; return false; } function isiPhone(){ return ( (navigator.platform.indexOf("iPhone") > -1) || (navigator.platform.indexOf("iPod") > -1) ); } var getKeyByValue = function (map, value){ for(var m in map){ if( map.hasOwnProperty( m ) ) { if( map[ m ] === value ) return m; } } } function getGeoLocationDescription(geographicLocation){ //GeographicLocations constants can be found in omeda-util GeographicLocation.. not connected to this project /* US("US", 1), * CANADIAN("Canadian", 2), * INTERNATIONAL("International", 3), * MEXICAN("Mexican", 4), * ANY("Any", 5), * REGION("Region", 6); */ var geoLocationDescription = ''; if(geographicLocation){ switch(geographicLocation){ case "1": geoLocationDescription = 'US'; break; case "2": geoLocationDescription = 'Canada'; break; case "3": geoLocationDescription = 'International'; break; case "4": geoLocationDescription = 'Mexico'; break; case "5": geoLocationDescription = 'All Locations'; break; } } return geoLocationDescription; } $(document).ready(function(){ function validatePhones(){ if ($("#Phones_200_Number").length > 0) validateAllPhone('Addresses_GROUP1_CountryCode', 'Phones_200_Number'); if ($("#Phones_230_Number").length > 0) validateAllPhone('Addresses_GROUP1_CountryCode', 'Phones_230_Number'); if ($("#Phones_240_Number").length > 0) validateCustomAllPhone('Addresses_GROUP1_CountryCode', 'Phones_240_Number'); } var countryField = $('#Addresses_GROUP1_CountryCode').not("input[type='hidden']"); //if region code and zip are not on the page, we do not need to bind these methods if(($('#Addresses_GROUP1_RegionCode').is(':visible'))&&($('#Addresses_GROUP1_RegionCode').length > 0 || $('#Addresses_GROUP1_PostalCode').length > 0)){ $('#Addresses_GROUP1_CountryCode').bind('change keyup', function() { validateRegionCountry('Addresses_GROUP1_CountryCode', 'Addresses_GROUP1_RegionCode'); validatePostalCode('Addresses_GROUP1_CountryCode', 'Addresses_GROUP1_PostalCode'); validatePhones(); if($(".shippingPostalCodeRequiredAsterisk").length > 0){ if($(this).val() !== '' && $(this).val() !== 'CAN' && $(this).val() !== 'USA'){ $(".shippingPostalCodeRequiredAsterisk").hide(); } else{ $(".shippingPostalCodeRequiredAsterisk").show(); } } }); } $('#Addresses_GROUP1_RegionCode').change(function () { if($('#Addresses_GROUP1_RegionCode').is(':visible')&& $('#Addresses_GROUP1_RegionCode').length > 0){ validateRegionCountry('Addresses_GROUP1_CountryCode', 'Addresses_GROUP1_RegionCode'); validateProvince('Addresses_GROUP1_RegionCode', 'Addresses_GROUP1_PostalCode'); } }); if(countryField && $(countryField).val() && $(countryField).val().length > 0){ $(countryField).change(); } $('#Addresses_GROUP1_PostalCode').bind('change keyup', function () { validateProvince('Addresses_GROUP1_RegionCode', 'Addresses_GROUP1_PostalCode'); }); var phoneField = $('#Phones_200_Number'); $(phoneField).bind('change', function() { validateAllPhone('Addresses_GROUP1_CountryCode', 'Phones_200_Number'); }); if(phoneField && $(phoneField).val() && $(phoneField).val().length > 0){ $(phoneField).change(); } var mobilePhoneField = $('#Phones_230_Number'); $('#Phones_230_Number').bind('change', function() { validateCustomAllPhone('Addresses_GROUP1_CountryCode', 'Phones_230_Number'); }); if(mobilePhoneField && $(mobilePhoneField).val() && $(mobilePhoneField).val().length > 0){ $(mobilePhoneField).change(); } var faxField = $('#Phones_240_Number'); $('#Phones_240_Number').bind('change', function() { validateCustomAllPhone('Addresses_GROUP1_CountryCode', 'Phones_240_Number'); }); if(faxField && $(faxField).val() && $(faxField).val().length > 0){ $(faxField).change(); } /* USERNAME LOOKUP - calls external customer id to see if username is avaiable */ $("#userName,#Username").on('focusout blur', function () { var username = $(this).val(); if (username != "" && $(this).valid()) findUsername(username); else $("#userNameResponse").text(''); }); $("#userName,#Username").blur(); }); </script> <style> .noscriptmsg{display:none;} </style> <noscript> <style type="text/css"> body div, body span, body p, body li, body ul{display:none;} body div.noscriptmsg{ display:block; text-align: center; background-color: white; margin-left: auto; margin-right: auto; width: 50%; padding: 20px; } </style> </noscript> </head> <body> <div class="sub-container row col-centered col-lg-8 col-md-10 col-xs-12"> <div class="sub-content "> <form id="paidform" action="/ieee/r-paid.do?p=WEBPAID" method="post"> <input type="hidden" name="OmedaCustomerId" value="" /> <input type="hidden" name="Addresses_GROUP1_AddressContactType" value="100" /> <input type="hidden" name="Emails_GROUP1_EmailContactType" value="300" /> <input type="hidden" name="BillingInformation_1_ExpirationDate" id="BillingInformation_1_ExpirationDate" value="" class="paid-input" /> <input type="hidden" name="abi1" id="abi1e" value="5891J1366578B2O" disabled /> <input type="hidden" name="abi2" id="abi2d" value="5891J1366578B2O" /> <input type="hidden" name="Products_2_Receive" id="magazine-receive-input" value="1"> <input type="hidden" name="BillingInformation_1_DoCharge" id="BillingInformation_1_DoCharge" value="True" class="paid-input" /> <input type="hidden" name="Products_2_Amount" value="" id="billingAmount" class="paid-input" /> <input type="hidden" name="Products_2_AmountPaid" value="" id="billingAmountPaid" class="paid-input" /> <input type="hidden" name="BillingInformation_1_Comment1" id="BillingInformation_1_Comment1" value="IEEE Spectrum" class="paid-input" /> <input type="hidden" name="BillingInformation_1_Comment2" id="BillingInformation_1_Comment2" value="" class="paid-input" /> <input type="hidden" name="isCustomerRenewing" id="isCustomerRenewing" value="false" /> <input type="hidden" name="productsSubmitted" id="productsSubmitted" value="2" /> <div class="inner-content"> <div id="pageheader"> <a target="_blank" href="http://spectrum.ieee.org/" class="generateOlyticsParams"> <img class="logo-image img-responsive" src="https://cdn.omeda.com/hosted/images/CLIENT_IEEE/SPCD/ieee-logo.png" /> </a> <div class="header-text"> <span>PAID SUBSCRIPTION REQUEST</span> </div> </div> <div id="body"> <div class="row"> <div class="col-xs-12"> <div class="row"> <div class="col-md-8 col-xs-12 padding-top"> <i>IEEE Spectrum</i> is the flagship magazine and website of the IEEE, the world's largest professional technology organization. We keep you informed about important trends and developments in technology, engineering, and science. <p></p> Our blogs, podcasts, news and features stories, videos and interactive infographics engage our readers, viewers and listeners with clear explanations of emerging technologies, providing you with details you won't get elsewhere.<p></p> <i>IEEE Spectrum</i> touches its audience on every platform, whether they're reading the print edition, coming to the websites from their desktops, tablets or smartphones, through email newsletters or following us on Facebook, Twitter and LinkedIn. <p></p> <p>When you subscribe to IEEE Spectrum for just $74.95, (12 issues), you'll be on the frontlines of the technology business. </p> <p>So subscribe today and see why leading global technologists say IEEE Spectrum is their most important source for new technology trends.</p> <p> Please note: These subscriptions are for individual subscribers ONLY and cannot be ordered as part of an institutional or bulk subscription program.</p> <p><strong>Print Subscription? Digital Edition? Want both formats?</strong><br/>When you subscribe to IEEE Spectrum, you have the option of receiving your IEEE Spectrum subscription in print only-format, in digital edition-only format, or in both print and digital formats. You can read your digital edition through a browser, or on your iPad, Android, or Kindle.</p> <p>Subscribe now!</p> </div> <div class="col-md-4 col-xs-12" style="padding-right: 25px;"> <div id="promo-code-HTML-content"> <div class="cacheContent"> <p> <strong>North America (US and Canada)</strong></br> 12 Issues (one year)<br> Print only for $74.95<br> Digital only for $49.95<br> Print/Digital combination for $99.95 </p> <p> <strong>International</strong></br> 12 Issues (one year)<br> Print only for $99.95<br> Digital only for $49.95<br> Print/Digital combination for $149.95 </p> <p>The digital edition format can be accessed three ways: through your web browser, through a digital PDF download and/or delivered to your iPad.</p> <p>You can cancel your subscription at any time and receive a full refund for any undelivered issues.</p> <p>If you have any questions, need assistance in completing the form or wish to speak with a customer service representative to order your subscription:</p> <p> In the U.S., toll-free: +1 866 363 2304<br> International calls: 001 615 377 3322<br> e-mail: <a href="mailto:ieee@omeda.com">ieee@omeda.com</a> </p> <p> If you wish to remit your payment by check, (funds must be drawn on a USA bank) you can do so by mailing it to the following address:</br></br> IEEE Spectrum</br> PO Box 1387</br> Northbrook, IL 60065-1387</br> </p></div> </div> </div> </div> <input type="hidden" name="PromoCode" value="WEBPAID" /> <div class="row"> <div class="text-center col-xs-12"> <h3 class="bold main-color" style="margin-top:0px;">Delivery Address</h3> </div> <div class="padding-bottom col-md-8 col-xs-12"> <div class="input-column-container"> <!-- shipping address --> <div id="shipping-address-section" class=""> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Emails_GROUP1_EmailAddress">Email Address <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Emails_GROUP1_EmailAddress" name="Emails_GROUP1_EmailAddress" spellcheck="false" type="email" class="required email" value="" maxlength="80"/> </div> </div> <div id="confirm-email" class="row input-row "> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="EMAIL_ADDRESS2">Confirm Email Address <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input name="EMAIL_ADDRESS2" type="email" id="EMAIL_ADDRESS2" maxlength="80" class="required email confirmEmail" value="" spellcheck="false" /> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="FirstName">First Name <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="FirstName" name="FirstName" spellcheck="false" type="text" class="required alphaApostrophe input-field" value="" maxlength="28"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="LastName">Last Name <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="LastName" name="LastName" spellcheck="false" type="text" class="required alphaApostrophe input-field" value="" maxlength="28"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Title">Title <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Title" name="Title" spellcheck="false" type="text" class="required input-field" value="" maxlength="28"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Addresses_GROUP1_Company">Company</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Addresses_GROUP1_Company" name="Addresses_GROUP1_Company" spellcheck="false" type="text" class="input-field" value="" maxlength="28"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Addresses_GROUP1_Street">Street Address <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Addresses_GROUP1_Street" name="Addresses_GROUP1_Street" spellcheck="false" type="text" class="required input-field" value="" maxlength="28"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> &nbsp; </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Addresses_GROUP1_ApartmentMailStop" name="Addresses_GROUP1_ApartmentMailStop" spellcheck="false" placeholder="Department/Mail Stop (optional)" type="text" class="input-field" value="" maxlength="28"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Addresses_GROUP1_City">City <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Addresses_GROUP1_City" name="Addresses_GROUP1_City" spellcheck="false" type="text" class="required alphaNumeric input-field" value="" maxlength="20"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Addresses_GROUP1_RegionCode">State/Province <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <select id="Addresses_GROUP1_RegionCode" name="Addresses_GROUP1_RegionCode" class="required input-field "> <option value="">Select State/Province</option> <option class="USA-state" value="AL">Alabama</option> <option class="USA-state" value="AK">Alaska</option> <option class="USA-state" value="AS">American Samoa</option> <option class="USA-state" value="AZ">Arizona</option> <option class="USA-state" value="AR">Arkansas</option> <option class="USA-state" value="CA">California</option> <option class="USA-state" value="CO">Colorado</option> <option class="USA-state" value="CT">Connecticut</option> <option class="USA-state" value="DE">Delaware</option> <option class="USA-state" value="DC">District of Columbia</option> <option class="USA-state" value="FL">Florida</option> <option class="USA-state" value="GA">Georgia</option> <option class="USA-state" value="GU">Guam</option> <option class="USA-state" value="HI">Hawaii</option> <option class="USA-state" value="ID">Idaho</option> <option class="USA-state" value="IL">Illinois</option> <option class="USA-state" value="IN">Indiana</option> <option class="USA-state" value="IA">Iowa</option> <option class="USA-state" value="KS">Kansas</option> <option class="USA-state" value="KY">Kentucky</option> <option class="USA-state" value="LA">Louisiana</option> <option class="USA-state" value="ME">Maine</option> <option class="USA-state" value="MD">Maryland</option> <option class="USA-state" value="MA">Massachusetts</option> <option class="USA-state" value="MI">Michigan</option> <option class="USA-state" value="MN">Minnesota</option> <option class="USA-state" value="MS">Mississippi</option> <option class="USA-state" value="MO">Missouri</option> <option class="USA-state" value="MT">Montana</option> <option class="USA-state" value="NE">Nebraska</option> <option class="USA-state" value="NV">Nevada</option> <option class="USA-state" value="NH">New Hampshire</option> <option class="USA-state" value="NJ">New Jersey</option> <option class="USA-state" value="NM">New Mexico</option> <option class="USA-state" value="NY">New York</option> <option class="USA-state" value="NC">North Carolina</option> <option class="USA-state" value="ND">North Dakota</option> <option class="USA-state" value="MP">Northern Mariana Islands</option> <option class="USA-state" value="OH">Ohio</option> <option class="USA-state" value="OK">Oklahoma</option> <option class="USA-state" value="OR">Oregon</option> <option class="USA-state" value="PA">Pennsylvania</option> <option class="USA-state" value="PR">Puerto Rico</option> <option class="USA-state" value="RI">Rhode Island</option> <option class="USA-state" value="SC">South Carolina</option> <option class="USA-state" value="SD">South Dakota</option> <option class="USA-state" value="TN">Tennessee</option> <option class="USA-state" value="TX">Texas</option> <option class="USA-state" value="UT">Utah</option> <option class="USA-state" value="VT">Vermont</option> <option class="USA-state" value="VI">Virgin Islands</option> <option class="USA-state" value="VA">Virginia</option> <option class="USA-state" value="WA">Washington</option> <option class="USA-state" value="WV">West Virginia</option> <option class="USA-state" value="WI">Wisconsin</option> <option class="USA-state" value="WY">Wyoming</option> <option class="USA-state" value="-" disabled="disabled">----------------------------------------</option> <option class="USA-state" value="AA">U.S. Military - America (AA)</option> <option class="USA-state" value="AE">U.S. Military - Overseas Europe (AE)</option> <option class="USA-state" value="AP">U.S. Military - Overseas Pacific (AP)</option> <option class="USA-state" value="-" disabled="disabled">----------------------------------------</option> <option class="CAN-state" value="AB">ALBERTA</option> <option class="CAN-state" value="BC">BRITISH COLUMBIA</option> <option class="CAN-state" value="MB">MANITOBA</option> <option class="CAN-state" value="NB">NEW BRUNSWICK</option> <option class="CAN-state" value="NL">NEWFOUNDLAND AND LABRADOR</option> <option class="CAN-state" value="NS">NOVA SCOTIA</option> <option class="CAN-state" value="NT">NORTHWEST TERRITORIES</option> <option class="CAN-state" value="NU">NUNAVUT</option> <option class="CAN-state" value="ON">ONTARIO</option> <option class="CAN-state" value="PE">PRINCE EDWARD ISLAND</option> <option class="CAN-state" value="QC">QUEBEC</option> <option class="CAN-state" value="SK">SASKATCHEWAN</option> <option class="CAN-state" value="YT">YUKON TERRITORY</option> <option class="INT-state" value="-" disabled="disabled">----------------------------------------</option> <option class="INT-state" value="53">I am not in the U.S. or Canada</option> </select> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Addresses_GROUP1_CountryCode">Country <span class="required-asterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <select id="Addresses_GROUP1_CountryCode" name="Addresses_GROUP1_CountryCode" class="required input-field "> <option value="">Select Country</option> <option region="North America" class="USA" value="USA">United States</option> <option region="North America" class="CAN" value="CAN">Canada</option> <option region="Asia" class="AFG" value="AFG">Afghanistan</option> <option region="Europe" class="ALB" value="ALB">Albania</option> <option region="Africa" class="DZA" value="DZA">Algeria</option> <option region="Oceania" class="ASM" value="ASM">American Samoa</option> <option region="Europe" class="AND" value="AND">Andorra</option> <option region="Africa" class="AGO" value="AGO">Angola</option> <option region="North America" class="AIA" value="AIA">Anguilla</option> <option region="Antarctica" class="ATA" value="ATA">Antarctica</option> <option region="North America" class="ATG" value="ATG">Antigua and Barbuda</option> <option region="South America" class="ARG" value="ARG">Argentina</option> <option region="Asia" class="ARM" value="ARM">Armenia</option> <option region="EU" class="ABW" value="ABW">Aruba</option> <option region="Africa" class="ASC" value="ASC">Ascension Island</option> <option region="Oceania" class="AUS" value="AUS">Australia</option> <option region="EU" class="AUT" value="AUT">Austria</option> <option region="Asia" class="AZE" value="AZE">Azerbaijan</option> <option region="North America" class="BHS" value="BHS">Bahamas</option> <option region="Asia" class="BHR" value="BHR">Bahrain</option> <option region="Asia" class="BGD" value="BGD">Bangladesh</option> <option region="North America" class="BRB" value="BRB">Barbados</option> <option region="Europe" class="BLR" value="BLR">Belarus</option> <option region="EU" class="BEL" value="BEL">Belgium</option> <option region="North America" class="BLZ" value="BLZ">Belize</option> <option region="Africa" class="BEN" value="BEN">Benin</option> <option region="North America" class="BMU" value="BMU">Bermuda</option> <option region="Asia" class="BTN" value="BTN">Bhutan</option> <option region="South America" class="BOL" value="BOL">Bolivia</option> <option region="Europe" class="BIH" value="BIH">Bosnia and Herzegovina</option> <option region="Africa" class="BWA" value="BWA">Botswana</option> <option region="Antarctica" class="BVT" value="BVT">Bouvet Island</option> <option region="South America" class="BRA" value="BRA">Brazil</option> <option region="Asia" class="IOT" value="IOT">British Indian Ocean Territory</option> <option region="Asia" class="BRN" value="BRN">Brunei Darussalam</option> <option region="EU" class="BGR" value="BGR">Bulgaria</option> <option region="Africa" class="BFA" value="BFA">Burkina Faso</option> <option region="Africa" class="BDI" value="BDI">Burundi</option> <option region="Africa" class="CIV" value="CIV">C`ote d'Ivoire</option> <option region="Asia" class="KHM" value="KHM">Cambodia</option> <option region="Africa" class="CMR" value="CMR">Cameroon</option> <option region="North America" class="CAN" value="CAN">Canada</option> <option region="Africa" class="CPV" value="CPV">Cape Verde</option> <option region="North America" class="CYM" value="CYM">Cayman Islands</option> <option region="Africa" class="CAF" value="CAF">Central African Republic</option> <option region="Africa" class="TCD" value="TCD">Chad</option> <option region="South America" class="CHL" value="CHL">Chile</option> <option region="Asia" class="CHN" value="CHN">China</option> <option region="Asia" class="CXR" value="CXR">Christmas Island</option> <option region="Asia" class="CCK" value="CCK">Cocos (Keeling) Islands</option> <option region="South America" class="COL" value="COL">Colombia</option> <option region="Africa" class="COM" value="COM">Comoros</option> <option region="Africa" class="COG" value="COG">Congo</option> <option region="Africa" class="COD" value="COD">Congo, the Democratic Republic of the</option> <option region="Oceania" class="COK" value="COK">Cook Islands</option> <option region="North America" class="CRI" value="CRI">Costa Rica</option> <option region="EU" class="HRV" value="HRV">Croatia</option> <option region="North America" class="CUB" value="CUB">Cuba</option> <option region="EU" class="CYP" value="CYP">Cyprus</option> <option region="EU" class="CZE" value="CZE">Czech Republic</option> <option region="EU" class="DNK" value="DNK">Denmark</option> <option region="Africa" class="DJI" value="DJI">Djibouti</option> <option region="North America" class="DMA" value="DMA">Dominica</option> <option region="North America" class="DOM" value="DOM">Dominican Republic</option> <option region="South America" class="ECU" value="ECU">Ecuador</option> <option region="Africa" class="EGY" value="EGY">Egypt</option> <option region="North America" class="SLV" value="SLV">El Salvador</option> <option region="Africa" class="GNQ" value="GNQ">Equatorial Guinea</option> <option region="Africa" class="ERI" value="ERI">Eritrea</option> <option region="EU" class="EST" value="EST">Estonia</option> <option region="Africa" class="ETH" value="ETH">Ethiopia</option> <option region="South America" class="FLK" value="FLK">Falkland Islands (Malvinas)</option> <option region="Europe" class="FRO" value="FRO">Faroe Islands</option> <option region="Oceania" class="FJI" value="FJI">Fiji</option> <option region="EU" class="FIN" value="FIN">Finland</option> <option region="EU" class="FRA" value="FRA">France</option> <option region="EU" class="GUF" value="GUF">French Guiana</option> <option region="EU" class="FXX" value="FXX">France, Metropolitan</option> <option region="EU" class="PYF" value="PYF">French Polynesia</option> <option region="EU" class="ATF" value="ATF">French Southern Territories</option> <option region="Africa" class="GAB" value="GAB">Gabon</option> <option region="Africa" class="GMB" value="GMB">Gambia</option> <option region="Asia" class="GEO" value="GEO">Georgia</option> <option region="EU" class="DEU" value="DEU">Germany</option> <option region="Africa" class="GHA" value="GHA">Ghana</option> <option region="EU" class="GIB" value="GIB">Gibraltar</option> <option region="EU" class="GRC" value="GRC">Greece</option> <option region="North America" class="GRL" value="GRL">Greenland</option> <option region="North America" class="GRD" value="GRD">Grenada</option> <option region="EU" class="GLP" value="GLP">Guadeloupe</option> <option region="Oceania" class="GUM" value="GUM">Guam</option> <option region="North America" class="GTM" value="GTM">Guatemala</option> <option region="Europe" class="GGY" value="GGY">Guernsey</option> <option region="Africa" class="GIN" value="GIN">Guinea</option> <option region="Africa" class="GNB" value="GNB">Guinea-Bissau</option> <option region="South America" class="GUY" value="GUY">Guyana</option> <option region="North America" class="HTI" value="HTI">Haiti</option> <option region="Antarctica" class="HMD" value="HMD">Heard Island and McDonald Islands</option> <option region="Europe" class="VAT" value="VAT">Holy See (Vatican City State)</option> <option region="North America" class="HND" value="HND">Honduras</option> <option region="Asia" class="HKG" value="HKG">Hong Kong</option> <option region="EU" class="HUN" value="HUN">Hungary</option> <option region="EU" class="ISL" value="ISL">Iceland</option> <option region="Asia" class="IND" value="IND">India</option> <option region="Asia" class="IDN" value="IDN">Indonesia</option> <option region="Asia" class="IRN" value="IRN">Iran</option> <option region="Asia" class="IRQ" value="IRQ">Iraq</option> <option region="EU" class="IRL" value="IRL">Ireland</option> <option region="EU" class="IMN" value="IMN">Isle of Man</option> <option region="Asia" class="ISR" value="ISR">Israel</option> <option region="EU" class="ITA" value="ITA">Italy</option> <option region="North America" class="JAM" value="JAM">Jamaica</option> <option region="Asia" class="JPN" value="JPN">Japan</option> <option region="Europe" class="JEY" value="JEY">Jersey</option> <option region="Asia" class="JOR" value="JOR">Jordan</option> <option region="Asia" class="KAZ" value="KAZ">Kazakhstan</option> <option region="Africa" class="KEN" value="KEN">Kenya</option> <option region="Oceania" class="KIR" value="KIR">Kiribati</option> <option region="Asia" class="PRK" value="PRK">Korea, Democratic People's Republic of</option> <option region="Asia" class="KOR" value="KOR">Korea, Republic of</option> <option region="Asia" class="KWT" value="KWT">Kuwait</option> <option region="Asia" class="KGZ" value="KGZ">Kyrgyzstan</option> <option region="Asia" class="LAO" value="LAO">Lao People's Democratic Republic</option> <option region="EU" class="LVA" value="LVA">Latvia</option> <option region="Asia" class="LBN" value="LBN">Lebanon</option> <option region="Africa" class="LSO" value="LSO">Lesotho</option> <option region="Africa" class="LBR" value="LBR">Liberia</option> <option region="Africa" class="LBY" value="LBY">Libyan Arab Jamahiriya</option> <option region="EU" class="LIE" value="LIE">Liechtenstein</option> <option region="EU" class="LTU" value="LTU">Lithuania</option> <option region="EU" class="LUX" value="LUX">Luxembourg</option> <option region="Asia" class="MAC" value="MAC">Macao</option> <option region="Europe" class="MKD" value="MKD">Macedonia, the former Yugoslav Republic of</option> <option region="Africa" class="MDG" value="MDG">Madagascar</option> <option region="Africa" class="MWI" value="MWI">Malawi</option> <option region="Asia" class="MYS" value="MYS">Malaysia</option> <option region="Asia" class="MDV" value="MDV">Maldives</option> <option region="Africa" class="MLI" value="MLI">Mali</option> <option region="EU" class="MLT" value="MLT">Malta</option> <option region="Oceania" class="MHL" value="MHL">Marshall Islands</option> <option region="EU" class="MTQ" value="MTQ">Martinique</option> <option region="Africa" class="MRT" value="MRT">Mauritania</option> <option region="Africa" class="MUS" value="MUS">Mauritius</option> <option region="EU" class="MYT" value="MYT">Mayotte</option> <option region="North America" class="MEX" value="MEX">Mexico</option> <option region="Oceania" class="FSM" value="FSM">Micronesia, Federated States of</option> <option region="Europe" class="MDA" value="MDA">Moldova, Republic of</option> <option region="Europe" class="MCO" value="MCO">Monaco</option> <option region="Asia" class="MNG" value="MNG">Mongolia</option> <option region="Europe" class="MNE" value="MNE">Montenegro</option> <option region="North America" class="MSR" value="MSR">Montserrat</option> <option region="Africa" class="MAR" value="MAR">Morocco</option> <option region="Africa" class="MOZ" value="MOZ">Mozambique</option> <option region="Asia" class="MMR" value="MMR">Myanmar</option> <option region="Africa" class="NAM" value="NAM">Namibia</option> <option region="Oceania" class="NRU" value="NRU">Nauru</option> <option region="Asia" class="NPL" value="NPL">Nepal</option> <option region="EU" class="NLD" value="NLD">Netherlands</option> <option region="EU" class="ANT" value="ANT">Netherlands Antilles</option> <option region="Oceania" class="NCL" value="NCL">New Caledonia</option> <option region="Oceania" class="NZL" value="NZL">New Zealand</option> <option region="North America" class="NIC" value="NIC">Nicaragua</option> <option region="Africa" class="NER" value="NER">Niger</option> <option region="Africa" class="NGA" value="NGA">Nigeria</option> <option region="Oceania" class="NIU" value="NIU">Niue</option> <option region="Oceania" class="NFK" value="NFK">Norfolk Island</option> <option region="Oceania" class="MNP" value="MNP">Northern Mariana Islands</option> <option region="EU" class="NOR" value="NOR">Norway</option> <option region="Asia" class="OMN" value="OMN">Oman</option> <option region="Asia" class="PAK" value="PAK">Pakistan</option> <option region="Oceania" class="PLW" value="PLW">Palau</option> <option region="Asia" class="PSE" value="PSE">Palestinian Territory, Occupied</option> <option region="North America" class="PAN" value="PAN">Panama</option> <option region="Oceania" class="PNG" value="PNG">Papua New Guinea</option> <option region="South America" class="PRY" value="PRY">Paraguay</option> <option region="South America" class="PER" value="PER">Peru</option> <option region="Asia" class="PHL" value="PHL">Philippines</option> <option region="Oceania" class="PCN" value="PCN">Pitcairn</option> <option region="EU" class="POL" value="POL">Poland</option> <option region="EU" class="PRT" value="PRT">Portugal</option> <option region="North America" class="PRI" value="PRI">Puerto Rico</option> <option region="Asia" class="QAT" value="QAT">Qatar</option> <option region="EU" class="REU" value="REU">R`eunion</option> <option region="EU" class="ROU" value="ROU">Romania</option> <option region="Europe" class="RUS" value="RUS">Russian Federation</option> <option region="Africa" class="RWA" value="RWA">Rwanda</option> <option region="Africa" class="SHN" value="SHN">Saint Helena</option> <option region="North America" class="KNA" value="KNA">Saint Kitts and Nevis</option> <option region="North America" class="LCA" value="LCA">Saint Lucia</option> <option region="EU" class="MAF" value="MAF">Saint Martin</option> <option region="North America" class="SPM" value="SPM">Saint Pierre and Miquelon</option> <option region="North America" class="VCT" value="VCT">Saint Vincent and the Grenadines</option> <option region="Oceania" class="WSM" value="WSM">Samoa</option> <option region="Europe" class="SMR" value="SMR">San Marino</option> <option region="Africa" class="STP" value="STP">Sao Tome and Principe</option> <option region="Asia" class="SAU" value="SAU">Saudi Arabia</option> <option region="Africa" class="SEN" value="SEN">Senegal</option> <option region="Europe" class="SRB" value="SRB">Serbia</option> <option region="Africa" class="SYC" value="SYC">Seychelles</option> <option region="Africa" class="SLE" value="SLE">Sierra Leone</option> <option region="Asia" class="SGP" value="SGP">Singapore</option> <option region="EU" class="SVK" value="SVK">Slovakia</option> <option region="EU" class="SVN" value="SVN">Slovenia</option> <option region="Oceania" class="SLB" value="SLB">Solomon Islands</option> <option region="Africa" class="SOM" value="SOM">Somalia</option> <option region="Africa" class="ZAF" value="ZAF">South Africa</option> <option region="Antarctica" class="SGS" value="SGS">South Georgia and the South Sandwich Islands</option> <option region="Africa" class="SSD" value="SSD">South Sudan</option> <option region="EU" class="ESP" value="ESP">Spain</option> <option region="Asia" class="LKA" value="LKA">Sri Lanka</option> <option region="Africa" class="SDN" value="SDN">Sudan</option> <option region="South America" class="SUR" value="SUR">Suriname</option> <option region="Europe" class="SJM" value="SJM">Svalbard and Jan Mayen</option> <option region="Africa" class="SWZ" value="SWZ">Swaziland</option> <option region="EU" class="SWE" value="SWE">Sweden</option> <option region="Europe" class="CHE" value="CHE">Switzerland</option> <option region="Asia" class="SYR" value="SYR">Syrian Arab Republic</option> <option region="Asia" class="TWN" value="TWN">Taiwan, Province of China</option> <option region="Asia" class="TJK" value="TJK">Tajikistan</option> <option region="Africa" class="TZA" value="TZA">Tanzania, United Republic of</option> <option region="Asia" class="THA" value="THA">Thailand</option> <option region="Asia" class="TLS" value="TLS">Timor-Leste</option> <option region="Africa" class="TGO" value="TGO">Togo</option> <option region="Oceania" class="TKL" value="TKL">Tokelau</option> <option region="Oceania" class="TON" value="TON">Tonga</option> <option region="North America" class="TTO" value="TTO">Trinidad and Tobago</option> <option region="Africa" class="TUN" value="TUN">Tunisia</option> <option region="Asia" class="TUR" value="TUR">Turkey</option> <option region="Asia" class="TKM" value="TKM">Turkmenistan</option> <option region="North America" class="TCA" value="TCA">Turks and Caicos Islands</option> <option region="Oceania" class="TUV" value="TUV">Tuvalu</option> <option region="Africa" class="UGA" value="UGA">Uganda</option> <option region="Europe" class="UKR" value="UKR">Ukraine</option> <option region="Asia" class="ARE" value="ARE">United Arab Emirates</option> <option region="EU" class="GBR" value="GBR">United Kingdom</option> <option region="North America" class="USA" value="USA">United States</option> <option region="Oceania" class="UMI" value="UMI">United States Minor Outlying Islands</option> <option region="South America" class="URY" value="URY">Uruguay</option> <option region="Asia" class="UZB" value="UZB">Uzbekistan</option> <option region="Oceania" class="VUT" value="VUT">Vanuatu</option> <option region="South America" class="VEN" value="VEN">Venezuela</option> <option region="Asia" class="VNM" value="VNM">Viet Nam</option> <option region="North America" class="VGB" value="VGB">Virgin Islands, British</option> <option region="North America" class="VIR" value="VIR">Virgin Islands, U.S.</option> <option region="Oceania" class="WLF" value="WLF">Wallis and Futuna</option> <option region="Africa" class="ESH" value="ESH">Western Sahara</option> <option region="Asia" class="YEM" value="YEM">Yemen</option> <option region="Africa" class="ZMB" value="ZMB">Zambia</option> <option region="Africa" class="ZWE" value="ZWE">Zimbabwe</option> <option region="Asia" class="LAO" value="LAO">Laos</option> <option region="Asia" class="NZL" value="NZL">New Zealand</option> <option region="Asia" class="PRK" value="PRK">South Korea</option> </select> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Addresses_GROUP1_PostalCode">Zip/Postal Code <span class="required-asterisk shippingPostalCodeRequiredAsterisk">*</span></label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Addresses_GROUP1_PostalCode" name="Addresses_GROUP1_PostalCode" spellcheck="false" type="text" class="input-field " value="" maxlength="10"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Phones_200_Number">Business Phone:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Phones_200_Number" name="Phones_200_Number" spellcheck="false" type="text" class="genericPhone" value="" maxlength="20"/> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="Phones_240_Number">Business Fax:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input id="Phones_240_Number" name="Phones_240_Number" spellcheck="false" type="text" class="genericFax" value="" maxlength="20"/> </div> </div> </div> </div> </div> <div class="hidden-sm hidden-xs"> <div class="col-md-4 col-xs-12" style="padding-right: 25px;"> <img src="https://cdn.omeda.com/hosted/images/CLIENT_IEEE/SPCD/ieee-cover.jpg" class="img-responsive" alt="IEEE Spectrum" /> </div> </div> </div> <div class="row"> <div class="text-center col-xs-12"> <h3 class="bold main-color content-block thin-border-top" style="margin: 0px 10px;font-size: 24px;">Billing Address</h3> </div> <div class="col-xs-12"> <div class="input-column-container"> <div class="row"> <div class="checkbox text-center col-xs-12"> <label> <input type="checkbox" id="toggleBillingAddress"> Please check if Billing Address is different from delivery address </label> </div> <div id="billing-address-section" class="col-md-8 col-xs-12 padding-bottom" style="display:none;"> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="BillingInformation_1_NameOnCard">Name:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input name="BillingInformation_1_NameOnCard" type="text" id="BillingInformation_1_NameOnCard" value="" maxlength="100" class="required alphaApostrophe input-field billing-address-field paid-input" /> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="BillingInformation_1_BillingStreet">Street Address:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input name="BillingInformation_1_BillingStreet" type="text" id="BillingInformation_1_BillingStreet" value="" maxlength="50" class="required input-field billing-address-field paid-input" /> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="BillingInformation_1_BillingCity">City:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input name="BillingInformation_1_BillingCity" type="text" id="BillingInformation_1_BillingCity" value="" maxlength="50" class="required input-field billing-address-field paid-input" /> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="BillingInformation_1_BillingRegion">State/Province:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <select name="BillingInformation_1_BillingRegion" id="BillingInformation_1_BillingRegion" class="required input-field billing-address-field paid-input" > <option value="">Select State/Province</option> <!-- only hiding fields' options if they are within the shipping address section --> <option value="AL" class="USA-state" >Alabama</option> <option value="AK" class="USA-state" >Alaska</option> <option value="AS" class="USA-state" >American Samoa</option> <option value="AZ" class="USA-state" >Arizona</option> <option value="AR" class="USA-state" >Arkansas</option> <option value="CA" class="USA-state" >California</option> <option value="CO" class="USA-state" >Colorado</option> <option value="CT" class="USA-state" >Connecticut</option> <option value="DE" class="USA-state" >Delaware</option> <option value="DC" class="USA-state" >District of Columbia</option> <option value="FL" class="USA-state" >Florida</option> <option value="GA" class="USA-state" >Georgia</option> <option value="GU" class="USA-state" >Guam</option> <option value="HI" class="USA-state" >Hawaii</option> <option value="ID" class="USA-state" >Idaho</option> <option value="IL" class="USA-state" >Illinois</option> <option value="IN" class="USA-state" >Indiana</option> <option value="IA" class="USA-state" >Iowa</option> <option value="KS" class="USA-state" >Kansas</option> <option value="KY" class="USA-state" >Kentucky</option> <option value="LA" class="USA-state" >Louisiana</option> <option value="ME" class="USA-state" >Maine</option> <option value="MD" class="USA-state" >Maryland</option> <option value="MA" class="USA-state" >Massachusetts</option> <option value="MI" class="USA-state" >Michigan</option> <option value="MN" class="USA-state" >Minnesota</option> <option value="MS" class="USA-state" >Mississippi</option> <option value="MO" class="USA-state" >Missouri</option> <option value="MT" class="USA-state" >Montana</option> <option value="NE" class="USA-state" >Nebraska</option> <option value="NV" class="USA-state" >Nevada</option> <option value="NH" class="USA-state" >New Hampshire</option> <option value="NJ" class="USA-state" >New Jersey</option> <option value="NM" class="USA-state" >New Mexico</option> <option value="NY" class="USA-state" >New York</option> <option value="NC" class="USA-state" >North Carolina</option> <option value="ND" class="USA-state" >North Dakota</option> <option value="MP" class="USA-state" >Northern Mariana Islands</option> <option value="OH" class="USA-state" >Ohio</option> <option value="OK" class="USA-state" >Oklahoma</option> <option value="OR" class="USA-state" >Oregon</option> <option value="PA" class="USA-state" >Pennsylvania</option> <option value="PR" class="USA-state" >Puerto Rico</option> <option value="RI" class="USA-state" >Rhode Island</option> <option value="SC" class="USA-state" >South Carolina</option> <option value="SD" class="USA-state" >South Dakota</option> <option value="TN" class="USA-state" >Tennessee</option> <option value="TX" class="USA-state" >Texas</option> <option value="UT" class="USA-state" >Utah</option> <option value="VT" class="USA-state" >Vermont</option> <option value="VI" class="USA-state" >Virgin Islands</option> <option value="VA" class="USA-state" >Virginia</option> <option value="WA" class="USA-state" >Washington</option> <option value="WV" class="USA-state" >West Virginia</option> <option value="WI" class="USA-state" >Wisconsin</option> <option value="WY" class="USA-state" >Wyoming</option> <option value="">----------------------------------------</option> <option value="AA" >U.S. Military - America (AA)</option> <option value="AE" >U.S. Military - Overseas Europe (AE)</option> <option value="AP" >U.S. Military - Overseas Pacific (AP)</option> <option value="">----------------------------------------</option> <option value="AB" class="CAN-state" >ALBERTA</option> <option value="BC" class="CAN-state" >BRITISH COLUMBIA</option> <option value="MB" class="CAN-state" >MANITOBA</option> <option value="NB" class="CAN-state" >NEW BRUNSWICK</option> <option value="NL" class="CAN-state" >NEWFOUNDLAND AND LABRADOR</option> <option value="NS" class="CAN-state" >NOVA SCOTIA</option> <option value="NT" class="CAN-state" >NORTHWEST TERRITORIES</option> <option value="NU" class="CAN-state" >NUNAVUT</option> <option value="ON" class="CAN-state" >ONTARIO</option> <option value="PE" class="CAN-state" >PRINCE EDWARD ISLAND</option> <option value="QC" class="CAN-state" >QUEBEC</option> <option value="SK" class="CAN-state" >SASKATCHEWAN</option> <option value="YT" class="CAN-state" >YUKON TERRITORY</option> <option value="">----------------------------------------</option> <option value="53" >I am not in the U.S. or Canada</option> </select> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="BillingInformation_1_BillingCountryCode">Country:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <select name="BillingInformation_1_BillingCountryCode" id="BillingInformation_1_BillingCountryCode" class="required input-field billing-address-field paid-input"> <option value="">Select Country&nbsp;&nbsp;</option> <option value="USA" class="USA">United States</option> <option value="CAN" class="CAN">Canada</option> <option value="AFG" class="AS">Afghanistan</option> <option value="ALB" class="EU">Albania</option> <option value="DZA" class="AF">Algeria</option> <option value="ASM" class="OC">American Samoa</option> <option value="AND" class="EU">Andorra</option> <option value="AGO" class="AF">Angola</option> <option value="AIA" class="CA">Anguilla</option> <option value="ATA" >Antarctica</option> <option value="ATG" class="CA">Antigua and Barbuda</option> <option value="ARG" class="SA">Argentina</option> <option value="ARM" class="AS">Armenia</option> <option value="ABW" class="CA">Aruba</option> <option value="ASC" class="AF">Ascension Island</option> <option value="AUS" class="OC">Australia</option> <option value="AUT" class="EU">Austria</option> <option value="AZE" class="AS">Azerbaijan</option> <option value="BHS" class="CA">Bahamas</option> <option value="BHR" class="ME">Bahrain</option> <option value="BGD" class="AS">Bangladesh</option> <option value="BRB" class="CA">Barbados</option> <option value="BLR" class="EU">Belarus</option> <option value="BEL" class="EU">Belgium</option> <option value="BLZ" class="NA">Belize</option> <option value="BEN" class="AF">Benin</option> <option value="BMU" class="CA">Bermuda</option> <option value="BTN" class="AS">Bhutan</option> <option value="BOL" class="SA">Bolivia</option> <option value="BIH" class="EU">Bosnia and Herzegovina</option> <option value="BWA" class="AF">Botswana</option> <option value="BVT" >Bouvet Island</option> <option value="BRA" class="SA">Brazil</option> <option value="IOT" >British Indian Ocean Territory</option> <option value="BRN" class="AS">Brunei Darussalam</option> <option value="BGR" class="EU">Bulgaria</option> <option value="BFA" class="AF">Burkina Faso</option> <option value="BDI" class="AF">Burundi</option> <option value="CIV" class="AF">C`ote d'Ivoire</option> <option value="KHM" class="AS">Cambodia</option> <option value="CMR" class="AF">Cameroon</option> <option value="CAN" class="CAN">Canada</option> <option value="CPV" class="AF">Cape Verde</option> <option value="CYM" class="CA">Cayman Islands</option> <option value="CAF" class="AF">Central African Republic</option> <option value="TCD" class="AF">Chad</option> <option value="CHL" class="SA">Chile</option> <option value="CHN" class="AS">China</option> <option value="CXR" >Christmas Island</option> <option value="CCK" >Cocos (Keeling) Islands</option> <option value="COL" class="SA">Colombia</option> <option value="COM" class="AF">Comoros</option> <option value="COG" class="AF">Congo</option> <option value="COD" class="AF">Congo, the Democratic Republic of the</option> <option value="COK" class="OC">Cook Islands</option> <option value="CRI" class="NA">Costa Rica</option> <option value="HRV" class="EU">Croatia</option> <option value="CUB" class="NA">Cuba</option> <option value="CYP" class="EU">Cyprus</option> <option value="CZE" class="EU">Czech Republic</option> <option value="DNK" class="EU">Denmark</option> <option value="DJI" class="AF">Djibouti</option> <option value="DMA" class="NA">Dominica</option> <option value="DOM" class="NA">Dominican Republic</option> <option value="ECU" class="SA">Ecuador</option> <option value="EGY" class="AF">Egypt</option> <option value="SLV" class="NA">El Salvador</option> <option value="GNQ" class="AF">Equatorial Guinea</option> <option value="ERI" class="AF">Eritrea</option> <option value="EST" class="EU">Estonia</option> <option value="ETH" class="AF">Ethiopia</option> <option value="FLK" class="SA">Falkland Islands (Malvinas)</option> <option value="FRO" class="EU">Faroe Islands</option> <option value="FJI" class="OC">Fiji</option> <option value="FIN" class="EU">Finland</option> <option value="FRA" class="EU">France</option> <option value="GUF" class="AF">French Guiana</option> <option value="PYF" class="OC">French Polynesia</option> <option value="ATF" >French Southern Territories</option> <option value="GAB" class="AF">Gabon</option> <option value="GMB" class="AF">Gambia</option> <option value="GEO" class="AS">Georgia</option> <option value="DEU" class="EU">Germany</option> <option value="GHA" class="AF">Ghana</option> <option value="GIB" class="EU">Gibraltar</option> <option value="GRC" class="EU">Greece</option> <option value="GRL" class="EU">Greenland</option> <option value="GRD" class="NA">Grenada</option> <option value="GLP" class="CA">Guadeloupe</option> <option value="GUM" class="OC">Guam</option> <option value="GTM" class="AF">Guatemala</option> <option value="GGY" class="EU">Guernsey</option> <option value="GIN" class="AF">Guinea</option> <option value="GNB" class="AF">Guinea-Bissau</option> <option value="GUY" class="AF">Guyana</option> <option value="HTI" class="CA">Haiti</option> <option value="HMD" >Heard Island and McDonald Islands</option> <option value="VAT" class="EU">Holy See (Vatican City State)</option> <option value="HND" class="AF">Honduras</option> <option value="HKG" class="AS">Hong Kong</option> <option value="HUN" class="EU">Hungary</option> <option value="ISL" class="EU">Iceland</option> <option value="IND" class="AS">India</option> <option value="IDN" class="AS">Indonesia</option> <option value="IRN" class="ME">Iran</option> <option value="IRQ" class="ME">Iraq</option> <option value="IRL" class="EU">Ireland</option> <option value="IMN" >Isle of Man</option> <option value="ISR" class="ME">Israel</option> <option value="ITA" class="EU">Italy</option> <option value="JAM" class="NA">Jamaica</option> <option value="JPN" class="AS">Japan</option> <option value="JEY" class="EU">Jersey</option> <option value="JOR" class="ME">Jordan</option> <option value="KAZ" class="AS">Kazakhstan</option> <option value="KEN" class="AF">Kenya</option> <option value="KIR" class="OC">Kiribati</option> <option value="PRK" class="AS">Korea, Democratic People's Republic of</option> <option value="KOR" class="AS">Korea, Republic of</option> <option value="KWT" class="ME">Kuwait</option> <option value="KGZ" class="AS">Kyrgyzstan</option> <option value="LAO" class="AS">Lao People's Democratic Republic</option> <option value="LVA" class="EU">Latvia</option> <option value="LBN" class="ME">Lebanon</option> <option value="LSO" class="AF">Lesotho</option> <option value="LBR" >Liberia</option> <option value="LBY" class="ME">Libyan Arab Jamahiriya</option> <option value="LIE" class="EU">Liechtenstein</option> <option value="LTU" class="EU">Lithuania</option> <option value="LUX" class="EU">Luxembourg</option> <option value="MAC" class="AS">Macao</option> <option value="MKD" class="EU">Macedonia, the former Yugoslav Republic of</option> <option value="MDG" class="AF">Madagascar</option> <option value="MWI" class="AF">Malawi</option> <option value="MYS" class="AS">Malaysia</option> <option value="MDV" class="AS">Maldives</option> <option value="MLI" class="AF">Mali</option> <option value="MLT" class="EU">Malta</option> <option value="MHL" class="OC">Marshall Islands</option> <option value="MTQ" class="CA">Martinique</option> <option value="MRT" class="AF">Mauritania</option> <option value="MUS" class="AF">Mauritius</option> <option value="MYT" >Mayotte</option> <option value="MEX" class="MEX">Mexico</option> <option value="FSM" class="OC">Micronesia, Federated States of</option> <option value="MDA" class="EU">Moldova, Republic of</option> <option value="MCO" class="EU">Monaco</option> <option value="MNG" class="AS">Mongolia</option> <option value="MNE" class="EU">Montenegro</option> <option value="MSR" class="EU">Montserrat</option> <option value="MAR" class="AF">Morocco</option> <option value="MOZ" class="AF">Mozambique</option> <option value="MMR" class="AS">Myanmar</option> <option value="NAM" class="AF">Namibia</option> <option value="NRU" class="OC">Nauru</option> <option value="NPL" class="AS">Nepal</option> <option value="NLD" class="EU">Netherlands</option> <option value="ANT" class="CA">Netherlands Antilles</option> <option value="NCL" class="OC">New Caledonia</option> <option value="NZL" class="OC">New Zealand</option> <option value="NIC" class="NA">Nicaragua</option> <option value="NER" class="AF">Niger</option> <option value="NGA" class="AF">Nigeria</option> <option value="NIU" >Niue</option> <option value="NFK" >Norfolk Island</option> <option value="MNP" >Northern Mariana Islands</option> <option value="NOR" class="EU">Norway</option> <option value="OMN" class="ME">Oman</option> <option value="PAK" class="AS">Pakistan</option> <option value="PLW" class="AS">Palau</option> <option value="PSE" class="ME">Palestinian Territory, Occupied</option> <option value="PAN" class="NA">Panama</option> <option value="PNG" class="OC">Papua New Guinea</option> <option value="PRY" class="SA">Paraguay</option> <option value="PER" class="SA">Peru</option> <option value="PHL" class="AS">Philippines</option> <option value="PCN" class="EU">Pitcairn</option> <option value="POL" class="EU">Poland</option> <option value="PRT" class="EU">Portugal</option> <option value="PRI" class="CA">Puerto Rico</option> <option value="QAT" class="ME">Qatar</option> <option value="REU" >R`eunion</option> <option value="ROU" class="EU">Romania</option> <option value="RUS" class="EU">Russian Federation</option> <option value="RWA" class="AF">Rwanda</option> <option value="SHN" class="AF">Saint Helena</option> <option value="KNA" class="CA">Saint Kitts and Nevis</option> <option value="LCA" class="CA">Saint Lucia</option> <option value="MAF" >Saint Martin</option> <option value="SPM" class="AF">Saint Pierre and Miquelon</option> <option value="VCT" class="CA">Saint Vincent and the Grenadines</option> <option value="WSM" class="OC">Samoa</option> <option value="SMR" >San Marino</option> <option value="STP" class="AF">Sao Tome and Principe</option> <option value="SAU" class="ME">Saudi Arabia</option> <option value="SEN" class="AF">Senegal</option> <option value="SRB" class="EU">Serbia</option> <option value="SYC" class="AF">Seychelles</option> <option value="SLE" class="AF">Sierra Leone</option> <option value="SGP" class="AS">Singapore</option> <option value="SVK" class="EU">Slovakia</option> <option value="SVN" class="EU">Slovenia</option> <option value="SLB" >Solomon Islands</option> <option value="SOM" class="AF">Somalia</option> <option value="ZAF" class="AF">South Africa</option> <option value="SGS" >South Georgia and the South Sandwich Islands</option> <option value="SSD" class="AF">South Sudan</option> <option value="ESP" class="EU">Spain</option> <option value="LKA" class="AS">Sri Lanka</option> <option value="SDN" class="AF">Sudan</option> <option value="SUR" class="SA">Suriname</option> <option value="SJM" >Svalbard and Jan Mayen</option> <option value="SWZ" class="AF">Swaziland</option> <option value="SWE" class="EU">Sweden</option> <option value="CHE" class="EU">Switzerland</option> <option value="SYR" class="ME">Syrian Arab Republic</option> <option value="TWN" class="AS">Taiwan</option> <option value="TJK" class="AS">Tajikistan</option> <option value="TZA" class="AF">Tanzania, United Republic of</option> <option value="THA" class="AS">Thailand</option> <option value="TLS" class="AS">Timor-Leste</option> <option value="TGO" class="AF">Togo</option> <option value="TKL" >Tokelau</option> <option value="TON" class="OC">Tonga</option> <option value="TTO" class="CA">Trinidad and Tobago</option> <option value="TUN" class="AF">Tunisia</option> <option value="TUR" class="ME">Turkey</option> <option value="TKM" class="AS">Turkmenistan</option> <option value="TCA" class="CA">Turks and Caicos Islands</option> <option value="TUV" class="OC">Tuvalu</option> <option value="UGA" class="AF">Uganda</option> <option value="UKR" class="EU">Ukraine</option> <option value="ARE" class="ME">United Arab Emirates</option> <option value="GBR" class="EU">United Kingdom</option> <option value="USA" class="USA">United States</option> <option value="UMI" >United States Minor Outlying Islands</option> <option value="URY" class="AF">Uruguay</option> <option value="UZB" class="AS">Uzbekistan</option> <option value="VUT" class="OC">Vanuatu</option> <option value="VEN" class="SA">Venezuela</option> <option value="VNM" class="AS">Viet Nam</option> <option value="VGB" >Virgin Islands, British</option> <option value="VIR" class="CA">Virgin Islands, U.S.</option> <option value="WLF" class="OC">Wallis and Futuna</option> <option value="ESH" class="AF">Western Sahara</option> <option value="YEM" class="ME">Yemen</option> <option value="ZMB" class="AF">Zambia</option> <option value="ZWE" class="AF">Zimbabwe</option> </select> </div> </div> <div class="row input-row"> <div class="input-label col-lg-5 col-md-4 col-sm-3 col-xs-8"> <label for="BillingInformation_1_BillingPostalCode">Zip/Postal Code:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input name="BillingInformation_1_BillingPostalCode" type="text" id="BillingInformation_1_BillingPostalCode" value="" maxlength="30" class="required input-field billing-address-field paid-input" /> </div> </div> </div> </div> </div> </div> </div> <div class="promo-price-radio-section pricingOptionsArea"> <h3 class="bold main-color text-center">Subscription Terms</h3> <div id="promo-price-term-radio-section" class="col-xs-12 col-md-6"> <div> <label for="productPriceCode_2" class="error text-left" generated="true"></label> </div> <h4 class="bold"> 12 issues</h4> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19934" data-ppc-geoLocation="3" data-ppc-regionCode="" data-ppc-amount="49.95" data-ppc-reqversion="D" class="required ppc-radio-input ppc-email-required intPricing"/> <span class="bold">$49.95 - 1 Year Digital</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19935" data-ppc-geoLocation="3" data-ppc-regionCode="" data-ppc-amount="99.95" data-ppc-reqversion="P" class="required ppc-radio-input intPricing"/> <span class="bold">$99.95 - 1 Year Print</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19936" data-ppc-geoLocation="3" data-ppc-regionCode="" data-ppc-amount="149.95" data-ppc-reqversion="B" class="required ppc-radio-input ppc-email-required intPricing"/> <span class="bold">$149.95 - 1 Year Print/Digital combination</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19937" data-ppc-geoLocation="2" data-ppc-regionCode="" data-ppc-amount="49.95" data-ppc-reqversion="D" class="required ppc-radio-input ppc-email-required canPricing"/> <span class="bold">$49.95 - 1 Year Digital</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19938" data-ppc-geoLocation="2" data-ppc-regionCode="" data-ppc-amount="74.95" data-ppc-reqversion="P" class="required ppc-radio-input canPricing"/> <span class="bold">$74.95 - 1 Year Print</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19939" data-ppc-geoLocation="2" data-ppc-regionCode="" data-ppc-amount="99.95" data-ppc-reqversion="B" class="required ppc-radio-input ppc-email-required canPricing"/> <span class="bold">$99.95 - 1 Year Print/Digital combination</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19940" data-ppc-geoLocation="1" data-ppc-regionCode="" data-ppc-amount="49.95" data-ppc-reqversion="D" class="required ppc-radio-input ppc-email-required usPricing"/> <span class="bold">$49.95 - 1 Year Digital</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19941" data-ppc-geoLocation="1" data-ppc-regionCode="" data-ppc-amount="74.95" data-ppc-reqversion="P" class="required ppc-radio-input usPricing"/> <span class="bold">$74.95 - 1 Year Print</span> </label> </div> <div class="radio price-code-radio"> <label> <input type="radio" name="productPriceCode_2" value="19942" data-ppc-geoLocation="1" data-ppc-regionCode="" data-ppc-amount="99.95" data-ppc-reqversion="B" class="required ppc-radio-input ppc-email-required usPricing"/> <span class="bold">$99.95 - 1 Year Print/Digital combination</span> </label> </div> </div> </div> <script> $(document).ready(function(){ //include this inside a .ready() function clearAndHideResponsiveCCFields (){ clearBillingAddress(); disableCreditCardFields(); $(".compPromoShowHide").hide(); setBillingRequired = false; $("#BillingInformation_1_DoCharge").val(""); $("#BillingInformation_1_Comment1").val(""); $("#BillingInformation_1_Comment2").val(""); } function showBillingFields(){ $(".compPromoShowHide").show(); //if "setBillMe" is checked, doCharge should be set to false, otherwise it should be true $("#BillingInformation_1_DoCharge").val(!($('input[id="setBillMe"]:checked').length > 0)); $("#BillingInformation_1_Comment1").val("IEEE Spectrum"); $("#BillingInformation_1_Comment2").val(""); setBillingRequired = true; enableCreditCardFields(); } //this function may need to be updated if new country options are ever added outside USA, CAN, and INTL (such as MEX) function setGeoLocation(country){ if (country=='') return 0; if (country=='USA') return 1; if (country=='CAN') return 2; return 3; } function termgroupedCompCheck(){ var compPriceUsed = false; var aRecipientNeedsToPay = false; $("select[name^='recipient'][name$='Addresses_GROUP1_CountryCode']:visible").each(function(){ var geoLocationFromCountryField = setGeoLocation($(this).val()); if (geoLocationFromCountryField!=0){ $("label.promo-price-button.active").find("ul li").each(function(){ if ($(this).attr("data-geographic-location")==geoLocationFromCountryField && $(this).attr("data-ppc-amount")==0){ clearAndHideResponsiveCCFields(); compPriceUsed=true; } else if ($(this).attr("data-geographic-location")==geoLocationFromCountryField && $(this).attr("data-ppc-amount")!=0) aRecipientNeedsToPay = true; }); } }); if (aRecipientNeedsToPay) compPriceUsed=false; if (!compPriceUsed) showBillingFields(); } //need to hide billing/cc fields for responsive grid comp orders on click if there is a combo of comp and payment options $("label.promo-price-button").bind('click keyup blur', function(){ if ($(this).attr("data-ppc-amount")=="0"){ clearAndHideResponsiveCCFields(); } else if (!$("#setBillMe").is(":checked")){ showBillingFields(); return;//if we ever hit a single item that has a cost then we show the necessary fields and can stop checking } }); //need to hide billing/cc fields for responsive radio comp orders on click $("input.ppc-radio-input").bind('click change',function(){ if ($(this).attr("data-ppc-amount")==0) clearAndHideResponsiveCCFields(); else showBillingFields(); }); $('#Addresses_GROUP1_CountryCode').change(function(){ $("div.radio.price-code-radio").hide(); if ($(this).val()=="") { $( ".pricingOptionsArea" ).hide() } else if($(this).val()=="USA"){ $( ".usPricing" ).closest("div.radio.price-code-radio").show(); $( ".pricingOptionsArea" ).show() } else if ($(this).val()=="CAN"){ $( ".canPricing" ).closest("div.radio.price-code-radio").show(); $( ".pricingOptionsArea" ).show() } else if ($(this).val()!="CAN" && $(this).val()!="USA"){ $( ".intPricing" ).closest("div.radio.price-code-radio").show(); $( ".pricingOptionsArea" ).show() } }); $('#Addresses_GROUP1_CountryCode').change(); }); </script> <div class="row"> <div class="text-center col-xs-12"> <h3 class="bold main-color content-block thin-border-top" style="margin: 0px 10px;font-size: 24px;">Payment Information</h3> </div> <div class="col-xs-12"> <div class="padding-top input-column-container"> <div id="cc-section"> <div id="ccfields"> <input type="hidden" value="1" id="cardName" class="cardName paid-input" name="BillingInformation_1_CreditCardType"/> <div class="text-center row"> <!-- <input type="hidden" id="valid_cc_prefixes" value="4,5,3,6,3"/> --> <!-- --> <div class="col-xs-12 col-sm-6 col-sm-offset-3 bill-me-hide display-table-row"> <div class="visaSelected display-table-cell col-xs-2"> <img class="img-responsive cc-logo-image" src="/ieee/images/visa_logo.png" /> </div> <div class="mstcdSelected display-table-cell col-xs-2"> <img class="img-responsive cc-logo-image" src="/ieee/images/mastercard_logo.png" /> </div> <div class="amexSelected display-table-cell col-xs-2"> <img class="img-responsive cc-logo-image" src="/ieee/images/amex_logo.png" /> </div> <div class="discSelected display-table-cell col-xs-2"> <img class="img-responsive cc-logo-image" src="/ieee/images/discover_logo.png" /> </div> <div class="dinersSelected display-table-cell col-xs-2"> <img class="img-responsive cc-logo-image" src="/ieee/images/dinersclub_logo.png" /> </div> <input type="hidden" id="valid_cc_prefixes" value="4,5,2,3,6,3"/> </div> </div> <div class="col-md-9 col-xs-12 padding-bottom"> <div class="row"> <div class="row input-row bill-me-hide"> <div class="input-label col-lg-4 col-md-4 col-xs-12"> <label for="BillingInformation_1_CreditCardNumber">Credit Card Number:</label> </div> <div class="input-container col-lg-7 col-md-8 col-sm-8 col-xs-11"> <input type="text" name="BillingInformation_1_CreditCardNumber" maxlength="16" value="" id="cardNum" autocomplete="off" class="required ccgeneric digits paid-input"/> </div> </div> <div class="row input-row bill-me-hide"> <div class="input-label col-lg-4 col-md-4 col-xs-12 col-xs-12"> <label for="">Expiration Date:</label> </div> <div class="col-xs-6 col-sm-4"> <div class="input-container"> <select size="1" name="ExpMon" id="expMonth" class="required paid-input" style="font-size: 13px;"> <option value="">Select Month</option> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> </select> </div> </div> <div class="col-xs-5 col-sm-4"> <div class="input-container"> <select size="1" name="ExpYear" id="expYear" class="required paid-input" style="font-size: 13px;"> <option value="">Select Year</option> <option value="24">2024</option> <option value="25">2025</option> <option value="26">2026</option> <option value="27">2027</option> <option value="28">2028</option> <option value="29">2029</option> <option value="30">2030</option> <option value="31">2031</option> <option value="32">2032</option> <option value="33">2033</option> </select> </div> </div> <div class="col-xs-11 col-sm-8" > <span id="expError"> </span> </div> </div> <div class="row input-row bill-me-hide"> <div class="input-label col-lg-4 col-md-4 col-xs-12"> <label for="sCode">Security Code:</label> </div> <div class="col-xs-6 col-sm-4"> <div class="input-container"> <input type="text" name="BillingInformation_1_CardSecurityCode" maxlength="4" style="width: 4em;" value="" id="sCode" autocomplete="off" class="required digits paid-input"/> <a href="#" data-toggle="modal" data-target="#credit_card_hint" class="help-text">What is this?</a> <div> <label for="sCode" class="text-left error" generated="true"></label> </div> </div> </div> <div class="col-xs-5 col-sm-4"> </div> </div> </div> <!-- Modal credit card hint window --> <div class="modal fade" id="credit_card_hint" role="dialog"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">What is a security code?</h4> </div> <div class="modal-body"> <h4 class="bold">The Security Code is a 3 or 4-digit number.</h4> <div class="row input-row"> <div class="col-sm-12 col-md-6"> <h4>For Visa and MasterCard:</h4> <div>The Security Code is on the back of your credit card immediately following your card number:</div> <div> <img src="/ieee/images/visa.gif" class="img-responsive" /> </div> </div> <div class="col-sm-12 col-md-6"> <h4>For American Express:</h4> <div>The Security Code is on the front right side above last 5 digits of card number:</div> <div> <img src="/ieee/images/amex.gif" class="img-responsive" /> </div> </div> </div> <div class="row input-row"> <div class="text-center col-xs-12 col-sm-8 col-sm-offset-2"> This number prevents fraudulent charges to your credit card, such as someone stealing your credit card receipt and using that information to make purchase. </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> </div> </div> <script> if (false){ $("#ccfields").hide(); } </script> <input type="hidden" name="debugging" value="false"> </div> </div> </div> </div> </div> </div> <div id="pagefooter"> <div class="row"> <div class="col-xs-12"> <div class="thin-border-top text-center"> <label>For security purposes how many letters in the word "Spectrum"? <input type="text" name="botTrapQuestion" class="required" maxlength="10" style="width: 45px; text-align: center;"></label> <div class="row captcha" id="grecaptcha"> <div class="col-xs-12 col-lg-4 col-md-4" style="float:none; margin:0 auto;"> <div class="row"> <div class="col-xs-8 col-sm-12 col-lg-12 col-centered" > <div class="g-recaptcha" data-sitekey="6LdsfFsUAAAAAFi3tmy_6ukcyD3PxUw2vrQ6TS8f"></div> <input type="hidden" name="recaptchaResponse" id="recaptchaResponse" value="" /> </div> </div> </div> </div> <input type="submit" id="submit-button" value="SUBMIT" class="btn-lg btn-default active" /> </div> <div class="" style="font-size=1;font-family=Verdana, Arial, Helvetica, sans-serif;"> <div id="footer" class="text-center thin-border-top col-xs-12"> <div class="text-left"><img src="/ieee/images/ieeelogosm.gif" width="82" height="25" hspace="0"></div></br> <div>Your name and address information including email address will be used to correspond with you regarding your subscription, and to send you newsletters and other relevant information. You may withdraw your consent at any time by updating your preferences or by clicking unsubscribe in emails you receive. Please view our full <a href="http://www.ieee.org/security_privacy.html" class="main-color">Privacy Policy</a> for more details. </div></br> <div> IEEE Spectrum </br> 3 Park Avenue, 17th Floor</br> New York, NY 10016-5997 USA </div></br> <div>To contact customer service, please email <a href="mailto:ieee@omeda.com?subject=IEEE Spectrum" class="main-color bold">ieee@omeda.com</a> or call in U.S toll free +1 866 363 2304 for International calls: 001 615 377 3322 </div></br> </div> <span style="float:left"><font size="1">Copyright 漏 2016 Spectrum Magazine. All rights reserved.</font></span> <div align="right"> <a href="http://www.ieee.org/about/documentation/copyright/legal.html">Copyright</a> | <a href="http://www.ieee.org/about/documentation/copyright/legal.html">Terms & Conditions</a> | <a href="http://www.ieee.org/security_privacy.html">Privacy & Security</a> | <a href="mailto:spectrum-webmaster@ieee.org">Contact</a> </div> </div> </div> </div> </div> </div> </form> </div> </div> <div class="noscriptmsg"> This site requires JavaScript. Please enable JavaScript in your browser's settings and reload the page. </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10