CINXE.COM

Defense Daily 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"/> <!-- 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]--> <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="/dd/css/bootstrap-multiselect.css"/> <link rel="stylesheet" type="text/css" href="/dd/css/form-messages.css" type="text/css"> <link rel="stylesheet" type="text/css" media="screen" href="/dd/css/omeda.css"> <link rel="stylesheet" type="text/css" media="screen" href="/dd/css/responsive-form.css"> <link rel="stylesheet" type="text/css" media="screen" href="/dd/css/r-client.css"> <link rel="stylesheet" type="text/css" media="print" href="/dd/css/r-print.css"> <link rel="stylesheet" type="text/css" media="screen" href="/dd/css/r-brand.css"> <title>Defense Daily 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="/dd/js/bootstrap-multiselect.js"></script> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KLGQSLL');</script> <!-- End Google Tag Manager --> <script type="text/javascript" src="/dd/js/creditcard.js"></script> <script type="text/javascript" src="/dd/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_308_Receive']:checked")>0){ var yesNo = $("input[name^='Products_' + 308 + '_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(false) return false; } else if (countrySelected === "CAN"){ if(false) return false; } else if(false) 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_308_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('0'); else if (country === "CAN") $('#billingAmount').val('0'); else $('#billingAmount').val('0'); } 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" && true){ $('#billingAmount').val('0'); } else if(country === "CAN" && true){ $('#billingAmount').val('0'); } else if(true){ $('#billingAmount').val('0'); } } else if(requestedVersion == "D"){ if(false){ $('#billingAmount').val(''); } } } $('#billingAmountPaid').val($('#billingAmount').val()); } function addTaxToBillingAmount() { var total = parseFloat($("input[name=Products_308_SalesTax]").val()) + parseFloat($("input[name=Products_308_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_308_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_308_Term']"); var validate = false; $.each(termRadioButtons, function(index, element){ if($(element).is(':checked')){ validate = true; return false; } }); if(validate){ $("input[name='Products_308_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_308_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_308_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_308_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_308_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_AICD_" + 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_AICD_" + 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_AICD_' + demographicId + '_WriteInDesc"]'); if(!$(textField).length){ textField = $('input[name="OEC_Demographic_AICD_' + 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_308_RequestedVersion" !== "" && $(".promo-price-button").length > 0){ var requestedVersion = $("input[name=Products_308_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 && "" !== ""){ 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_308_RequestedVersion" !== ""){ requestedVersion = $("input[name=Products_308_RequestedVersion]:checked").val(); enableDigitalPassalong = $("input[name=Products_308_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="/dd/r-trial.do" 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="Products_308_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_308_Amount" value="0" id="billingAmount" class="paid-input" /> <input type="hidden" name="Products_308_AmountPaid" value="0" id="billingAmountPaid" class="paid-input" /> <input type="hidden" name="BillingInformation_1_Comment1" id="BillingInformation_1_Comment1" value="Defense Daily" 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="308" /> <div class="inner-content"> <div id="pageheader"> <img class="logo-image img-responsive" src="https://cdn.omeda.com/hosted/images/CLIENT_AI/AICD/dd-logo.jpg" /> <div class="header-text thin-border-top thin-border-bottom padding-top"> <span>Trial Subscription Order for Defense Daily Newsletter</span> </div> <div class="header-text"> Note: Trial subscriptions are available to qualified professionals only. Limit one trial per publication per year.<br> </div> <div class="header-text thin-border-bottom"> Please complete the fields below, then click "Submit" to begin receiving your trial issue(s) of <span class="bold">Defense Daily</span> </div> </div> <div id="body"> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KLGQSLL" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <div class="row"> <div class="col-xs-12"> <div style="display:none;"> <div id="term-pricing-options-section" class="padding-top input-column-container"> <input type="hidden" name="Products_308_RequestedVersion" value="D" /> <div> <label>Select your subscription term</label> </div> <div> <label class="text-left special-term-error error" style="display:none;">2-year subscriptions are only available for U.S. Residents. 1-year subscription has now been selected for you instead.</label> <label for="Products_308_Term" class="text-left jquery-validation-term-error error" generated="true"></label> </div> <div class="row"> <div class="btn-group" data-toggle="buttons" style="width:100%;"> <label class="btn btn-default paid-term-radio-button paid-term-1-label"> <input type="radio" name="Products_308_Term" id="term1radio" value="15" class="required term1radio paid-input" /> <span class="bold">1-year subscription</span> <ul> <li>U.S. Residents $0</li> <li>Canadian Residents $0</li> <li>International Residents $0 </li> </ul> </label> </div> </div> </div> </div> <div class="row"> <div class="padding-bottom col-md-8 col-xs-12"> <div class="input-column-container"> <script> $.validator.addMethod("excludeDomain", function(value, element) { if(/(@raytheon.com){1}$/i.test(value)){ return false; } else{ return true; } },"<div style='text-align:left'>Thank you for requesting a free trial. Unfortunately, at this moment your request cannot be completed. For further information please contact our Marketing Director, Elisabeth Mijuca at <a href='mailto:emijuca@accessintel.com'>emijuca@accessintel.com</a>.</div>"); </script> <!-- 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="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="50"/> </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="50"/> </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 allStandardChars" value="" maxlength="50"/> </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 <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_Company" name="Addresses_GROUP1_Company" spellcheck="false" type="text" class="required input-field allStandardChars" value="" maxlength="50"/> </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 allStandardChars" value="" maxlength="50"/> </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 allStandardCharsOptional" value="" maxlength="50"/> </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="50"/> </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/Canada Prov <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" selected="selected">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" selected="selected">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="Emails_GROUP1_EmailAddress">Email <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 excludeDomain" 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="Phones_200_Number">Telephone <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="Phones_200_Number" name="Phones_200_Number" spellcheck="false" type="text" class="required genericPhone" value="" maxlength="20"/> </div> </div> <div class="header-text" >Email address is required for subscription verification. For details about the use of the information, please read the <a href="http://www.accessintel.com/privacypolicy/">Privacy Statement.</a></div> </div> </div> </div> </div> <div id="responsive-cc-section" class="row compPromoShowHide" style="display:none;"> <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="/dd/images/visa_logo.png" /> </div> <div class="mstcdSelected display-table-cell col-xs-2"> <img class="img-responsive cc-logo-image" src="/dd/images/mastercard_logo.png" /> </div> <div class="amexSelected display-table-cell col-xs-2"> <img class="img-responsive cc-logo-image" src="/dd/images/amex_logo.png" /> </div> <input type="hidden" id="valid_cc_prefixes" value="4,5,2,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="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> <option value="34">2034</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="/dd/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="/dd/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> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class=""> <div id="demographics-section" class="padding-bottom thin-border-top"> <div class="padding-top"> <div class="demo-block"> <label for="Demographic_AICD_592" class="row"> <div class="col-xs-12"> What is your specific Job Function? <span class="required-asterisk">*</span> </div> <div class=""> <input type="text" name="Demographic_AICD_592" id="Demographic_AICD_592" maxlength="48" class="form-control demographic required" value="" spellcheck="false" /> </div> </label> </div> <div class="demo-block"> <label for="Demographic_AICD_593" class="row"> <div class="col-xs-12"> What types of Products or Services does your company provide? <span class="required-asterisk">*</span> </div> <div class=""> <input type="text" name="Demographic_AICD_593" id="Demographic_AICD_593" maxlength="48" class="form-control demographic required" value="" spellcheck="false" /> </div> </label> </div> <div class="demo-block"> <label> How did you hear about Defense Daily? </label> <div> <label for="Demographic_AICD_595" class="error" generated="true"></label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_595" id="Demographic_AICD_595_4298" class="demographic" value="4298"> Email </label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_595" id="Demographic_AICD_595_4300" class="demographic" value="4300"> Magazine/Newsletter Ad </label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_595" id="Demographic_AICD_595_4296" class="demographic" value="4296"> U.S. Mail </label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_595" id="Demographic_AICD_595_4294" class="demographic" value="4294"> TradeShow </label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_595" id="Demographic_AICD_595_4293" class="demographic" value="4293"> Word of Mouth </label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_595" id="Demographic_AICD_595_4299" class="demographic" value="4299"> Search Engine/Web Directory (ie. Google, Yahoo, etc) </label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_595" id="Demographic_AICD_595_4295" class="demographic demographic-other-value" value="4295"> Other </label> </div> <label> <div class="demo-other-input-container" style='display:hidden'> If you selected Other in the question above, please specify how you heard about Defense Daily below: <input type="text" name="Demographic_AICD_595_WriteInDesc" id="Demographic_AICD_595_WriteInDesc" maxlength="25"/> </div> </label> </div> <div class="demo-block"> <label> I would like to receive occasional promotional offers and product information alerts via email </label> <div> <label for="Demographic_AICD_596" class="error" generated="true"></label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_596" id="Demographic_AICD_596_4304" class="demographic" value="4304"> Yes </label> </div> <div class="radio"> <label> <input type="radio" name="Demographic_AICD_596" id="Demographic_AICD_596_4303" class="demographic" value="4303"> No </label> </div> </div> </div> </div> </div> </div> </div> <div class=" form-input-block"> <span class="promoText">If you received a promotional mailing or saw an advertisement promoting this site, please enter the code located on the mailing label above your name or on the advertisement copy:</span> <input type="text" name="PromoCode" size="12" maxlength="12" class="loginTextField"/> </div> </div> </div> </div> <div id="pagefooter"> <div class="form-group row"> <div class="header-text thin-border-top thin-border-bottom padding-top padding-left"> <span>Log-In Credentials for Online Access</span> </div> <div class="input-label col-lg-4 col-md-4 col-xs-12"> <label for="Username">Username <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="Username" name="Username" spellcheck="false" type="text" class="required username" value="" maxlength="50" autocomplete="off"/> <div class="text-left"> <label name="userNameResponse" id="userNameResponse"></label> </div> <input type="hidden" name="usernameLookupStatus" id="usernameLookupStatus" value="" /> </div> </div> <div class="form-group row"> <div class="input-label col-lg-4 col-md-4 col-xs-12"> <label for="Password">Password <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="password" name="Password" spellcheck="false" type="password" class="required auth-password limit-password" value="" maxlength="30" autocomplete="off"/> </div> </div> <div class="form-group row"> <div class="input-label col-lg-4 col-md-4 col-xs-12"> <label for="password_confirm">Verify Password <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="password_confirm" name="password_confirm" spellcheck="false" type="password" class="required auth-password limit-password" value="" maxlength="30" autocomplete="off"/> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="thin-border-top text-center"> <input type="submit" id="submit-button" value="SUBMIT" class="btn-lg btn-default active" /> </div> <div id="footer"> <p>*This offer cannot be combined with any other ongoing offers, promotions or discounts. Discounts are not applicable on previously invoiced or shipped orders.</p> <p>Visit us again at <a href="https://www.defensedaily.com" target="_blank">www.defensedaily.com</a></p> <p>Note: Online transactions require one business day to post to your account. You may also email <strong><a href="mailto:clientservices@accessintel.com" />clientservices@accessintel.com</a></strong> or call 800-777-5006 or 301-354-2101 Monday through Thursday, 9:00 am to 5:30 pm EST and Friday, 9:00 am to 3:00 pm EST, to place your order, or send your order/payment to: Access Intelligence, Attn: Client Services, 9211 Corporate Blvd, 4th Floor, Rockville, Maryland 20850 USA. </p> <p class="footer-copyright"> <span class="copyright">&copy; Access Intelligence, LLC. All rights reserved.</span> <a href="http://www.accessintel.com/privacypolicy/">Privacy Policy</a> </p> </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