'); $(".actions").css("justify-content", "center"); $(".actions").css("display", "flex"); if (typeof (Page_Validators) != 'undefined') { /* USED ON Customer Service - Create Case web page var newValidator = document.createElement('span'); newValidator.style.display = "none"; newValidator.id = "contactFieldValidator"; newValidator.controltovalidate = "primarycontactid"; newValidator.errormessage = " Contact is a required field. "; newValidator.initialvalue = ""; newValidator.evaluationfunction = function () { var customerType = $("#customerid_entityname").val(); if (customerType != "account") return true; // only require contact if customer type is account. var value = $("#primarycontactid").val(); if (value == null || value == "") { return false; } else { return true; } }; Page_Validators.push(newValidator); */ // add email validator var eVal = document.createElement('span'); eVal.style.display = "none"; eVal.id = "emailFieldValidator"; eVal.controltovalidate = "nlm_emailaddress"; eVal.errormessage = " Please make sure that Email Address field is formatted correctly. "; eVal.initialvalue = ""; eVal.evaluationfunction = function () { var email = $("#nlm_emailaddress").val(); if (email == null || email == "") { return false; } else { var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; return regex.test(email); } }; Page_Validators.push(eVal); } updateEntitlementRequired(); $("#customerid").change(onCustomerChange); $("#customerid").change(); /* save request data to a field Request params are stored in a cookie on Home categories page additional info may come from cookie created on another page. If it's not there, get it from url. */ var showAddInfo = false; if (getUrlParams('showAddInfo')) { showAddInfo = true; } if (!showAddInfo) { $(".section[data-name='MoreInfo']").closest("fieldset").hide(); } //Set browser agent if (navigator && navigator.userAgent) { $("#nlm_browseruseragent").val(navigator.userAgent); } //Wait a second to ensure any cookies that should have gotten set are set already setTimeout(function(){ //Set Referrer Cookie var referrerCookieVal = readCookie("nlm_referrer"); if(referrerCookieVal && referrerCookieVal != '') { $("#nlm_additionalsiteinfo").val(referrerCookieVal); } var pageNameCookieVal = readCookie("nlm_pagename"); if(pageNameCookieVal && pageNameCookieVal != '') { $("#nlm_pagename").val(pageNameCookieVal); } }, 100) }); function onCustomerChange() { var val = $("#customerid").val(); var entitlement = $("#entitlementid").parent(); var product = $("#productid").parent(); if (val) { disableEnable(entitlement, false); disableEnable(product, false); } else { disableEnable(entitlement, true); disableEnable(product, true); } updateContactRequired(); } function disableEnable($param, disabled) { $param.find('input').each(function () { $(this).attr("disabled", disabled); }); $param.find('button').each(function () { $(this).attr("disabled", disabled); }); } function updateContactRequired() { var customerTypeVal = $("#customerid_entityname").val(); if (customerTypeVal && customerTypeVal == "account") { $("#primarycontactid_label").parent().addClass("required"); } else { $("#primarycontactid_label").parent().removeClass("required"); } } function updateEntitlementRequired() { var entitlementField = $("#entitlementid"); if (entitlementField && entitlementField.closest('td').get(0) && entitlementField.closest('td').get(0).style.display == "none") { //remove required class and validator if entitlement isn't showing $("#entitlementid_label").parent().removeClass("required"); if (typeof (Page_Validators) == 'undefined') return; if ($("#RequiredFieldValidatorentitlementid") != 'undefined' && entitlementField.closest('td').get(0) && entitlementField.closest('td').get(0).style.display == "none") { $("#entitlementid_label").parent().removeClass("required"); Array.remove(Page_Validators, document.getElementById('RequiredFieldValidatorentitlementid')); } } } //check every 200ms if recaptacha is loaded && ready // if available, render var onloadCallback = function() { console.log("onloadcallback"); var loading = setInterval(function () { if (document.getElementById("g-recaptcha")) { console.log("grecaptcha available"); clearInterval(loading); grecaptcha.render('g-recaptcha', { 'sitekey' : "6Lf-VWkUAAAAAIBeFvqznBTByd16K3S5lb-8s0ho", 'callback' : recaptchaSuccess }); } }, 200); }; //recpatcha validated //add code to recaptcha field async function recaptchaSuccess(token) { console.log("token:" + token); $('#nlm_googlerecaptcha').val(token); await new Promise(resolve => setTimeout(resolve, 1000)); console.log('after 1 second'); $('#g-recaptcha').hide(); $('#InsertButton').show(); $('.btn-cancel').show(); }

MoreInfo

{{/if}}
-