CINXE.COM
Lufthansa Cargo Developer Portal - Home
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="P3Pv1" href="/w3c/p3p.xml" /> <link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@boomi/exosphere@3.0.0/dist/styles.css' /> <script type="text/javascript" > var csp = ''; var nonce = 'b933eaf8a16b876af734'; //<![CDATA[ var mashery_info = { }; // iframe'd detection, to pop out if in an iframe if (window.location !== parent.window.location && !(/(page|docs|blog)\/preview/.test(window.location.pathname))) { parent.window.location = window.location; } //]]> </script> <title>Lufthansa Cargo Developer Portal - Home</title> <link rel="stylesheet" type="text/css" media="screen" href="/files/LufthansaCargo.CSS" /> <script src="/public/Mashery/scripts/themes/blackbeard/placeholders.js" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ </script> <link rel="stylesheet" type="text/css" href="/files/font.css"> <script> //]]> </script> <!-- add syntax highlighter --> <script type="text/javascript" > if(window.SyntaxHighlighter != undefined) { // check for syntax highlighter load before using SyntaxHighlighter.all(); } </script> <!-- end syntax highlighter --> <!--[if lt IE 7.]> <link href="/public/Mashery/styles/IE6.css" type="text/css" media="screen" rel="stylesheet" /> <![endif]--> <!--[if IE 7]> <link href="/public/Mashery/styles/IE7.css" type="text/css" media="screen" rel="stylesheet" /> <![endif]--> <!--[if gte IE 8]> <link href="/public/Mashery/styles/IE8.css" type="text/css" media="screen" rel="stylesheet" /> <![endif]--> </head> <body id="page-page" class="page-page read en_US"> <!-- PAGE --> <div id="page" class="page read no_sub"> <!-- HEADER --> <div id="header" class="header"> <div id="branding" class="branding"> <div id="branding-logo" class="branding-logo"> Lufthansa Cargo Developer Portal </div><!-- /branding-logo --> <div id="branding-tagline"> </div><!-- /branding-tagline --> <!--div id="branding-mashery"></div --><!-- /branding-mashery --> </div><!-- /branding --> <div id="search" class="search"> <form id="search-input" class="search-input" method="get" action="/search"> <div> <input id="search-box" class="search-box" type="text" value="" name="q" /> <input id="search-button" class="search-button" type="submit" value="Search" /> </div> </form> </div> </div> <!-- /HEADER --> <div id="user" class="user"> <div id="user-auth" class="user-auth"> </div><!-- /user-auth --> <div id="user-main" class="user-main"> </div><!-- /user-main --> <div id="user-nav" class="user-nav"> <ul> <script > window. addEventListener('load', (event) => { var lastSignOut = document.getElementById("lastSignOut"); if(lastSignOut) { lastSignOut.addEventListener("click", function () { document.getElementById('mashery-logout-form').submit(); }); } }); </script> <li class="first sign-in"> <a href="https://developer.lufthansa-cargo.com/login/login?r=https%3A%2F%2Fdeveloper.lufthansa-cargo.com%2F&h=76b64ce2844894bf627f561cd9ef9b06">Sign In</a> </li> <li class="register"> <a href="https://developer.lufthansa-cargo.com/member/register">Register</a> </li> </ul> </div><!-- /user-nav --> <div id="user-menu"> </div> </div><!-- /user --> <div id="info" class="info" style="display: none;"> </div><!-- /info --> <!-- CONTENT --> <div id="content" class="content"> <div id="main" class="main"> <h1 class="first">Home</h1> <div class="section"> <div class="section-body"> <script> mashery.globals.noHeading = true; </script> <div class="bg-dark bg-hero padding-top-xlarge padding-bottom-xlarge text-center full-width" style="background-image: linear-gradient( rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3) ), url(/files/hero.jpg);"> <h1 class="text-hero no-margin-bottom">Welcome to our developer program!</h1> <p class="text-large">Discover the world of our APIs.</p> <p> <a class="btn btn-large" href="/docs/read/howtoconnect">Join Now</a> <a class="btn btn-secondary btn-large" href="/docs">Learn more about our APIs</a> </p> <p class="padding-top-xlarge"> <a href="#get-started"> <svg xmlns="http://www.w3.org/2000/svg" style="height: 2em; width: 2em;" viewBox="0 0 16 16" aria-describedby="start-here-title"><title id="start-here-title">Get Started</title><path fill="currentColor" d="M13.707 9.707l-5 5a.999.999 0 0 1-1.414 0l-5-5a.999.999 0 1 1 1.414-1.414L7 11.586V2a1 1 0 0 1 2 0v9.586l3.293-3.293a.997.997 0 0 1 1.414 0 .999.999 0 0 1 0 1.414z"/></svg> </a> </p> </div> <div class="padding-top-xlarge padding-bottom text-center full-width" id="get-started"> <div class="container"> <div class="row" style="text-align: center; color: #155724; background-color: #d4edda; border-color: #c3e6cb; position: relative; padding: .75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: .25rem;"> All APIs are operational and healthy. </div> </div> </div> <div class="padding-top-xlarge padding-bottom text-center full-width" id="get-started"> <div class="container"> <div class="row"> <div class="grid-dynamic margin-bottom"> <a class="link-block" href="/docs/read/howtoconnect"> <svg xmlns="http://www.w3.org/2000/svg" style="height: 3em; width: 3em;" viewBox="0 0 21 21"><title></title><path fill="#fdac2a" d="M18.576 4.961c-.528-3.126-3.381-5.215-6.372-4.663-2.992.551-5.519 2.957-4.991 6.085.112.673.428 1.726.801 2.483L2.58 16.975c-.201.299-.314.839-.254 1.198l.35 2.07a.643.643 0 0 0 .735.54l1.592-.295c.344-.062.781-.365.97-.671l2.149-3.477.019-.023 1.455-.269 2.51-4.073c.824.146 2.008.097 2.707-.033 2.99-.552 4.291-3.854 3.763-6.981zm-2.652 1.604c-.823 1.228-1.663.363-2.838-.499-1.175-.859-2.242-1.388-1.42-2.617.823-1.228 2.442-1.528 3.619-.667 1.176.86 1.461 2.554.638 3.782z"/></svg> <h3 class="h2 no-margin-bottom no-padding-top">Register</h3> <p class="margin-bottom-small">Get an access key and usage reports for your apps.</p> <p><span class="link-block-styled" style="text-decoration: none;">Learn more...</span></p> </a> </div> <div class="grid-dynamic margin-bottom"> <a class="link-block" href="/docs"> <svg xmlns="http://www.w3.org/2000/svg" style="height: 3em; width: 3em;" viewBox="0 0 21 21"><title></title><path fill="#808080" d="M20.368 7.786L12.552 5.69 11.184.586c-.114-.426-.572-.674-1.022-.555L.632 2.585c-.449.12-.72.565-.606.991L3.417 16.23c.114.426.571.675 1.02.553l3.794-1.015-.517 1.93c-.114.426.156.872.606.99l8.516 2.283c.449.121.905-.127 1.021-.555l3.118-11.638c.113-.426-.157-.871-.607-.99zM1.715 3.813l8.222-2.201 3.043 11.359-8.222 2.201L1.715 3.813zm14.747 15.573L9.307 17.43l.563-2.102 4.096-1.099c.449-.119.722-.564.607-.99L12.99 7.331l6.244 1.713-2.772 10.344z"/></svg> <h3 class="h2 no-margin-bottom no-padding-top">Read the Docs</h3> <p class="margin-bottom-small">Learn how to call our API from your applications.</p> <p><span class="link-block-styled" style="text-decoration: none;">Learn more...</span></p> </a> </div> <div class="grid-dynamic margin-bottom"> <a class="link-block" href="/io-docs"> <svg xmlns="http://www.w3.org/2000/svg" style="height: 3em; width: 3em;" viewBox="0 0 21 21"><title></title><path fill="currentColor" d="M6.005 15.488c-.248 0-.498-.087-.697-.265L-.005 10.5l5.608-4.985a1.051 1.051 0 0 1 1.395 1.57l-3.842 3.416 3.547 3.152a1.05 1.05 0 0 1-.697 1.836zm9.392-.003l5.608-4.985-5.313-4.723a1.05 1.05 0 0 0-1.395 1.57l3.547 3.153-3.842 3.415a1.05 1.05 0 0 0 1.394 1.571zm-4.912 1.488l2.1-12.6a1.05 1.05 0 0 0-2.071-.346l-2.1 12.6a1.05 1.05 0 0 0 2.07.346z"/></svg> <h3 class="h2 no-margin-bottom no-padding-top">Make a Call</h3> <p class="margin-bottom-small">Use our interactive documentation (IO Docs) to make a call.</p> <p><span class="link-block-styled" style="text-decoration: none;">Learn more...</span></p> </a> </div> <div class="grid-dynamic margin-bottom"> <a class="link-block" href="/contact"> <svg xmlns="http://www.w3.org/2000/svg" style="height: 3em; width: 3em;" viewBox="0 0 21 21"><title></title><path fill="#06184c" d="M6.09 12.81V6.3H2.1C.945 6.3 0 7.245 0 8.4v6.3c0 1.155.945 2.1 2.1 2.1h1.05v3.15L6.3 16.8h5.25c1.155 0 2.1-.945 2.1-2.1v-1.911a.972.972 0 0 1-.21.022l-7.35-.001zM18.9 1.05H9.45c-1.155 0-2.1.945-2.1 2.1v8.4h7.35l3.15 3.15v-3.15h1.05c1.155 0 2.1-.944 2.1-2.1v-6.3c0-1.155-.945-2.1-2.1-2.1z"/></svg> <h3 class="h2 no-margin-bottom no-padding-top">Get Support</h3> <p class="margin-bottom-small">Ask questions and get advice by sending an email to our support team.</p> <p><span class="link-block-styled" style="text-decoration: none;">Connect Now...</span></p> </a> </div> </div> </div> </div> </div> </div> <!-- END SECTION --> </div><!-- /main --> <!-- SUB --> <div id="sub" class="sub"> </div> <!-- /SUB --> <div id="breadcrumbs"> </div><!-- /breadcrumbs --> <div id="local" class="local"> <ul> <li class=" first"><a href="https://developer-test.lufthansa-cargo.com/">Developer Portal Test</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/docs">Overview APIs</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/docs/read/howtoconnect">How to connect</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/io-docs">Interactive API</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/news">News</a></li> <li class=" last"><a href="https://developer.lufthansa-cargo.com/contact">Contact</a></li> </ul> </div><!-- /local --> <div id="nav" class="nav"> </div><!-- /nav --> </div> <!-- /CONTENT --> <div id="footer" class="footer"> <ul> <li class=" first"><a href="https://developer.lufthansa-cargo.com/contact">Contact Us</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/termsandconditions">Terms</a></li> <li class=" "><a href="https://lufthansa-cargo.com/footer/bottomnav/imprint">Imprint</a></li> <li class=" last"><a href="https://lufthansa-cargo.com/footer/bottomnav/privacy">Privacy</a></li> </ul> <!-- SITEINFO --> <div id="siteinfo" class="siteinfo"> </div> <!-- /SITEINFO --> </div><!-- /footer --> </div> <!-- /page --> <!-- Start Branding script tag --> <script type="text/javascript" > // get the branding logo to set the mouseover/out and onclick var brandingLogo = document.getElementById('branding-logo'); if(brandingLogo != undefined) { brandingLogo.addEventListener("click", function () { location.href = "https://developer.lufthansa-cargo.com/"; }); brandingLogo.addEventListener("mouseover", function () { this.style.cursor = 'pointer'; }); brandingLogo.addEventListener("mouseout", function () { this.style.cursor = 'auto'; }); } // get the mashery logo to set the mouseover/out and onclick var masheryLogo = document.getElementById('branding-mashery'); if(masheryLogo != undefined) { masheryLogo.addEventListener("click", function () { location.href = "http://www.mashery.com/"; }); masheryLogo.addEventListener("mouseover", function () { this.style.cursor = 'pointer'; }); masheryLogo.addEventListener("mouseout", function () { this.style.cursor = 'auto'; }); } </script> <!-- End Branding script tag --> <!-- <div id="extra1"> </div> <div id="extra2"> </div> --> <script type="text/javascript" > const enableBoomiTheme = 0; window.isOidcUser = 0; </script> <script type="text/javascript" src="/public/Mashery/scripts/themes/blackbeard/app.js"></script> <script type="text/javascript"> //<![CDATA[ /*! * Templates & Initializations * lufthansa-cargo v2.0.0 * Portal Theme Starter Kit v2.10.0 - Default Theme * http://github.com/mashery/portal-theme-starter-kit */ /** * Theme Templates */ // Enable full width layouts window.portalOptions.templates.page = function() { return '<div class="main container container-small content" id="main">' + (mashery.globals.noHeading ? '' : '<h1>{{content.heading}}</h1>') + '{{content.main}}' + '</div>'; }; // Add theme style hook document.documentElement.className += ' js-theme-default'; // Logo portalOptions.logo = '<img alt="Lufthansa Cargo Developer Program" height="36" width="300" src="/files/logoNeu.png">'; // Favicon portalOptions.favicon = true; portalOptions.faviconSizes = '16x16 24x24 32x32 64x64'; /** * Initialize plugins */ window.addEventListener('portalAfterRender', function() { // Expand-and-collapse nav on small viewports astro.init(); // Enhanced documentation if (mashery.globals.betterDocs) { new BetterDocs('.content', { langs: [{ selector: 'bash', title: 'Bash' }, { selector: 'javascript, js', title: 'JavaScript', }, { selector: 'ruby', title: 'Ruby' }, { selector: 'python', title: 'Python' } ], langDefault: 'js', wideLayout: !mashery.globals.betterDocsOneColumn, }); } // Responsive iFrame Videos fluidvids.init({ selector: ['iframe', 'object'], // runs querySelectorAll() players: ['www.youtube.com', 'player.vimeo.com'] // players to support }); // Get the latest blog posts latestBlogPosts(); }, false); // // Record customer terms accepted on user registration // function getRequiredRegistrationTextFields() { // List of required text fields var requiredRegistrationTextFields = ["members-handle", "members-moniker", "members-email", "email_again", "passwd_new", "passwd_again", "applications-name" ]; return requiredRegistrationTextFields; } // All custom fields complete function isFormComplete() { var requiredRegistrationTextFields = getRequiredRegistrationTextFields(); for (var field = 0; field < requiredRegistrationTextFields.length; field++) { var textField = document.getElementById(requiredRegistrationTextFields[field]); if (!textField.value) { return false; } } var customerTerms = document.getElementById("customerTerms").checked; var masheryTerms = document.getElementById("masheryTerms").checked; var shipmentTrackingSubscribe = document.getElementById("shipmentTrackingSubscribe").checked; //CS7608 // var oneRecordAPIIdentityProvider = document.getElementById("oneRecordAPIIdentityProvider").checked; // var oneRecordAPIURI = document.getElementById("oneRecordAPIURI").checked; var oneRecordAPI = document.getElementById("oneRecordAPI").checked; // if (customerTerms && masheryTerms && (!shipmentTrackingSubscribe || ( // shipmentTrackingSubscribe && document.getElementById("applications-shipment_tracking_sub_callback") // .value))) { // return true; // } else { // return false; // } //CS7608 // if (customerTerms && masheryTerms && // (!shipmentTrackingSubscribe || ( shipmentTrackingSubscribe && document.getElementById("applications-shipment_tracking_sub_callback").value)) && // (!oneRecordAPIIdentityProvider || (oneRecordAPIIdentityProvider && document.getElementById("applications-recordapi_idpissuer_sub_callback").value && document.getElementById("applications-recordapi_idppuburl_sub_callback").value)) && // (!oneRecordAPIURI || (oneRecordAPIURI && document.getElementById("applications-recordapi_recorduri_sub_callback").value)) // ) { // return true; // } else { // return false; // } // CS7608 Customers wants to make other fields (idppuburl,idpissuer ) of OneRecordAPI optional // (!oneRecordAPI || (oneRecordAPI && document.getElementById("applications-recordapi_idpissuer_sub_callback").value && document.getElementById("applications-recordapi_idppuburl_sub_callback").value) && document.getElementById("applications-recordapi_recorduri_sub_callback").value)) if (customerTerms && masheryTerms && (!shipmentTrackingSubscribe || ( shipmentTrackingSubscribe && document.getElementById("applications-shipment_tracking_sub_callback").value)) && (!oneRecordAPI || (oneRecordAPI && document.getElementById("applications-recordapi_recorduri_sub_callback").value))) { return true; } else { return false; } } // Update member form field when terms checked function setRequestedApisAndAcceptedTerms() { var acceptedTerms = ""; if (isFormComplete()) { var now = new Date(); var apis = document.getElementsByClassName("customerAPI"); var checkedApis = ""; for (let i = 0; i < apis.length; i++) { if (apis[i].checked == true) checkedApis = checkedApis + apis[i].nextSibling.data + ','; } document.getElementById("applications-requested_api_access").value = checkedApis; document.getElementById("applications-terms_and_conditions_accepted").value = now.toISOString(); document.getElementById("members-terms_accepted").value = now.toISOString(); document.getElementById("process-register").disabled = false; } else { document.getElementById("process-register").disabled = true; document.getElementById("members-terms_accepted").value = ""; } } // Update member form field when terms checked function setRequestedApisAndAcceptedTermsForEdit() { var acceptedTerms = ""; if (document.getElementById("customerTerms").checked) { var now = new Date(); var apis = document.getElementsByClassName("customerAPI"); var checkedApis = ""; for (let i = 0; i < apis.length; i++) { if (apis[i].checked == true) checkedApis = checkedApis + apis[i].nextSibling.data + ','; } document.getElementById("applications-requested_api_access").value = checkedApis; document.getElementById("applications-terms_and_conditions_accepted").value = now.toISOString(); document.getElementById("process-save").disabled = false; } else { document.getElementById("process-save").disabled = true; } } // Show shipment tracking callback url field function showShipmentTrackingSubscribeCallbackField() { var required = document.getElementById("shipmentTrackingSubscribe").checked; var fieldId = "applications-shipment_tracking_sub_callback"; if (required) { document.getElementById(fieldId).parentElement.classList.add("require"); document.getElementById(fieldId).classList.add("require"); document.getElementById(fieldId).hidden = false; if (!document.getElementById(fieldId).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); document.getElementById(fieldId).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // CS7608 Show oneRecordAPI callback url field function showoneRecordAPICallbackField() { var required = document.getElementById("oneRecordAPI").checked; var fieldId = "applications-recordapi_idpissuer_sub_callback"; var fieldId2 = "applications-recordapi_idppuburl_sub_callback"; var fieldID3 = "applications-recordapi_recorduri_sub_callback"; if (required) { //CS7608 Customer wants to make this field optional // document.getElementById(fieldId2).parentElement.classList.add("require"); // document.getElementById(fieldId2).classList.add("require"); document.getElementById(fieldId2).hidden = false; //CS7608 Customer wants to make this field optional // document.getElementById(fieldId).parentElement.classList.add("require"); // document.getElementById(fieldId).classList.add("require"); document.getElementById(fieldId).hidden = false; document.getElementById(fieldID3).parentElement.classList.add("require"); document.getElementById(fieldID3).classList.add("require"); document.getElementById(fieldID3).hidden = false; if (!document.getElementById(fieldID3).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } if (!document.getElementById(fieldId2).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } if (!document.getElementById(fieldId).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldID3).parentElement.classList.remove("require"); document.getElementById(fieldID3).classList.remove("require"); document.getElementById(fieldID3).hidden = true; document.getElementById(fieldId2).parentElement.classList.remove("require"); document.getElementById(fieldId2).classList.remove("require"); document.getElementById(fieldId2).hidden = true; document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); document.getElementById(fieldId).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { //CS7608 Customer wants to make this field optional // elem.classList.add("require"); // elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label Need to repeat as 2 sub-field labelss are controled by 1 checkbox els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId2.toLowerCase()) { if (required) { //CS7608 Customer wants to make this field optional // elem.classList.add("require"); // elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldID3.toLowerCase() ) { if (required) { // CS7608 Customer wants to make this field optional elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // CS7608 Show oneRecordAPIIdentityProvider callback url field // CS7608 Should be removed if showoneRecordAPICallbackField function is used function showoneRecordAPIIdentityProviderCallbackField() { var required = document.getElementById("oneRecordAPIIdentityProvider").checked; var fieldId = "applications-recordapi_idpissuer_sub_callback"; var fieldId2 = "applications-recordapi_idppuburl_sub_callback"; if (required) { document.getElementById(fieldId2).parentElement.classList.add("require"); document.getElementById(fieldId2).classList.add("require"); document.getElementById(fieldId2).hidden = false; document.getElementById(fieldId).parentElement.classList.add("require"); document.getElementById(fieldId).classList.add("require"); document.getElementById(fieldId).hidden = false; if (!document.getElementById(fieldId2).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } if (!document.getElementById(fieldId).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldId2).parentElement.classList.remove("require"); document.getElementById(fieldId2).classList.remove("require"); document.getElementById(fieldId2).hidden = true; document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); document.getElementById(fieldId).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label Need to repeat as 2 sub-field labelss are controled by 1 checkbox els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId2.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label descr CS7608 Kamlesh trying out var eld = document.getElementsByTagName("descr"); for (var i = 0; i < eld.length; i++) { var elem = eld[i]; if ((elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) || (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId2.toLowerCase())){ if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // CS7608 Show oneRecordAPIURI callback url field // CS7608 Should be removed if showoneRecordAPICallbackField function is used function showoneRecordAPIURICallbackField() { var required = document.getElementById("oneRecordAPIURI").checked; var fieldID3 = "applications-recordapi_recorduri_sub_callback"; if (required) { document.getElementById(fieldID3).parentElement.classList.add("require"); document.getElementById(fieldID3).classList.add("require"); document.getElementById(fieldID3).hidden = false; if (!document.getElementById(fieldID3).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldID3).parentElement.classList.remove("require"); document.getElementById(fieldID3).classList.remove("require"); document.getElementById(fieldID3).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldID3.toLowerCase() ) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label descr CS7608 Kamlesh trying out var eld = document.getElementsByTagName("descr"); for (var i = 0; i < eld.length; i++) { var elem = eld[i]; if ((elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldID3.toLowerCase())) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // Check custom required fields and set submit disabled/enabled function updateSubmit() { // updated requested apis and accepted terms fields setRequestedApisAndAcceptedTerms(); if (isFormComplete()) { document.getElementById("process-register").disabled = false; } else { document.getElementById("process-register").disabled = true; } } // Check custom required fields and set submit disabled/enabled function updateSubmitForEdit() { // updated requested apis and accepted terms fields setRequestedApisAndAcceptedTermsForEdit(); if (document.getElementById("customerTerms").checked) { document.getElementById("process-save").disabled = false; } else { document.getElementById("process-save").disabled = true; } } // Display custom terms to user and add hidden field to store accepted terms window.addEventListener('portalAfterRender', function() { // Only run on member registration page if (!document.getElementById("page-member")) return; // Disable registration button until terms accepted const submit = document.getElementById("process-register"); submit.disabled = true; // Hide field storing accepted terms and its label document.getElementById("members-terms_accepted").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'members-terms_accepted') { elem.remove(); break; } } // Hide field storing oAuth callback url and its label document.getElementById("applications-oauth_redirect_uri").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-oauth_redirect_uri') { elem.remove(); break; } } // Hide field storing requested API access and its label document.getElementById("applications-requested_api_access").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-requested_api_access') { // remove descr elem.parentElement.getElementsByClassName("descr").forEach(elem => elem.remove()); elem.remove(); break; } } // Hide field storing requested API access and its label document.getElementById("applications-terms_and_conditions_accepted").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-terms_and_conditions_accepted') { elem.remove(); break; } } // Hide field storing shipment tracking subscribe callback document.getElementById("applications-shipment_tracking_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-shipment_tracking_sub_callback') { elem.hidden = true; break; } } //CS 7608 // Hide field storing recordapi identity provider issuer callback document.getElementById("applications-recordapi_idpissuer_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idpissuer_sub_callback') { // elem.parentElement.getElementsByClassName("descr").forEach(elem => elem.remove()); // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS 7608 // Hide field storing recordapi identity provider publickey url callback document.getElementById("applications-recordapi_idppuburl_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idppuburl_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS 7608 // Hide field storing recordapi one record uri callback document.getElementById("applications-recordapi_recorduri_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_recorduri_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } // Hide first para (it is duplicated) var paras = document.getElementsByTagName('p'); paras[0].hidden = true; paras[0].fontSize = "0%"; // Display customer terms //CS7608 added onclick actions for RoutingOffer // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIIdentityProvider" onclick="showoneRecordAPIIdentityProviderCallbackField()" onchange="updateSubmit()">ONE Record API - Use own Identity Provider</label> \ // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIURI" onclick="showoneRecordAPIURICallbackField()" onchange="updateSubmit()">ONE Record API - Use own ONE Record API</label> \ var apisRequested = '<p> \ <h3>Required API access</h3> \ <b>Select open API you would like to use:<br></b> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTracking" onchange="updateSubmit()">Shipment Tracking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTrackingSubscribe" onclick="showShipmentTrackingSubscribeCallbackField()" onchange="updateSubmit()">Shipment Tracking Subscribe API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="routingOffer" onchange="updateSubmit()">Routing Offer API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="stationInformation" onchange="updateSubmit()">Station Information API</label><br> \ <b>Select partner API (access will only be given upon prior approval and agreement by LH):</b><br> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="smartBooking" onchange="updateSubmit()">smartBooking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="airmail" onchange="updateSubmit()">Airmail API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoXML" onchange="updateSubmit()">CargoXML API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoIMP" onchange="updateSubmit()">CargoIMP API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="uldStatus" onchange="updateSubmit()">ULD Status API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPI" onclick="showoneRecordAPICallbackField()" onchange="updateSubmit()">ONE Record API</label> \ </p>'; var summHTML = document.getElementById("applications-summ").parentElement.innerHTML; document.getElementById("applications-summ").parentElement.innerHTML = summHTML + apisRequested; var customerTerms = '<label style="font-weight:normal"><input type="checkbox" id="customerTerms" onclick="setRequestedApisAndAcceptedTerms()">I agree to the <a href="/files/General_Terms_and_Conditions_API.pdf" target="_blank">General Terms and Conditions</a> and the applicable <a href="/files/Terms_of_Services.pdf" target="_blank">Terms of Services</a>.</label>'; // MUST have existing Mashery terms too - it's a TIBCO account var masheryTerms = '<label style="font-weight:normal"><input type="checkbox" id="masheryTerms" onclick="setRequestedApisAndAcceptedTerms()">I certify that I have read and agree to the <a href="http://www.mashery.com/terms/" target="_blank" >Mashery Terms of Service</a> and <a href="http://www.mashery.com/privacy/" target="_blank">Privacy Policy</a>.</label><br>'; document.getElementById("registration-terms-of-service").innerHTML = ""; // Push the terms above the submit button var submitHTML = document.getElementById("process-register").parentElement .innerHTML; document.getElementById("process-register").parentElement.innerHTML = customerTerms + masheryTerms + submitHTML; document.getElementById("registration-terms-of-service").innerHTML = ""; // Add call back URL field input document.getElementById("applications-shipment_tracking_sub_callback").setAttribute( "oninput", "updateSubmit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idpissuer_sub_callback").setAttribute( "oninput", "updateSubmit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idppuburl_sub_callback").setAttribute( "oninput", "updateSubmit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_recorduri_sub_callback").setAttribute( "oninput", "updateSubmit()"); // Add call back for text field input var requiredRegistrationTextFields = getRequiredRegistrationTextFields(); for (var field = 0; field < requiredRegistrationTextFields.length; field++) { var textField = document.getElementById(requiredRegistrationTextFields[field]); textField.setAttribute("oninput", "updateSubmit()"); } }); // Hide fields in apps edit page window.addEventListener('portalAfterRender', function() { // Only run on apps edit page if (document.getElementsByClassName("category-appedit").length == 0) return; // Disable registration button until terms accepted const submit = document.getElementById("process-save"); submit.disabled = true; // Hide field storing oAuth callback url and its label document.getElementById("applications-oauth_redirect_uri").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-oauth_redirect_uri') { elem.remove(); break; } } // Hide field storing requested API access and its label document.getElementById("applications-requested_api_access").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-requested_api_access') { // remove descr var descr = elem.parentElement.getElementsByClassName("descr"); for (var n = 0; n < descr.length; n++) { descr[n].remove(); } elem.remove(); break; } } // Hide field storing terms and conditions accepted and its label document.getElementById("applications-terms_and_conditions_accepted").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-terms_and_conditions_accepted') { elem.remove(); break; } } // Hide field storing shipment tracking subscribe callback document.getElementById("applications-shipment_tracking_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-shipment_tracking_sub_callback') { elem.hidden = true; break; } } //CS7608 // Hide field storing recordapi identityprovider tracking subscribe callback document.getElementById("applications-recordapi_idpissuer_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idpissuer_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS7608 // Hide field storing recordapi identityprovider tracking subscribe callback document.getElementById("applications-recordapi_idppuburl_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idppuburl_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS7608 // Hide field storing recordapi onerecorduri tracking subscribe callback document.getElementById("applications-recordapi_recorduri_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_recorduri_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } // Display customer terms // CS7608 Added oneRecordAPIIdentityProvider, oneRecordAPIURI // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIIdentityProvider" onclick="showoneRecordAPIIdentityProviderCallbackField()" onchange="updateSubmitForEdit()">ONE Record API - Use own Identity Provider</label> \ // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIURI" onclick="showoneRecordAPIURICallbackField()" onchange="updateSubmitForEdit()">ONE Record API - Use own ONE Record API</label> \ var apisRequested = '<p> \ <h3>Request further API access</h3> \ <p>Please select APIs you would like request access to. Further access will be granted after approval.</p> \ <b>Select open API:<br></b> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTracking" onchange="updateSubmitForEdit()">Shipment Tracking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTrackingSubscribe" onclick="showShipmentTrackingSubscribeCallbackField()" onchange="updateSubmitForEdit()">Shipment Tracking Subscribe API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="routingOffer" onchange="updateSubmitForEdit()">Routing Offer API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="stationInformation" onchange="updateSubmitForEdit()">Station Information API</label><br> \ <b>Select partner API (access will only be given upon prior approval and agreement by LH):</b><br> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="smartBooking" onchange="updateSubmitForEdit()">smartBooking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="airmail" onchange="updateSubmitForEdit()">Airmail API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoXML" onchange="updateSubmitForEdit()">CargoXML API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoIMP" onchange="updateSubmitForEdit()">CargoIMP API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="uldStatus" onchange="updateSubmitForEdit()">ULD Status API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPI" onclick="showoneRecordAPICallbackField()" onchange="updateSubmit()">ONE Record API</label> \ </p>'; var summHTML = document.getElementById("applications-summ").parentElement.innerHTML; document.getElementById("applications-summ").parentElement.innerHTML = summHTML + apisRequested; var customerTerms = '<label style="font-weight:normal"><input type="checkbox" id="customerTerms" onclick="setRequestedApisAndAcceptedTermsForEdit()">I agree to the <a href="/files/General_Terms_and_Conditions_API.pdf" target="_blank">General Terms and Conditions</a> and the applicable <a href="/files/Terms_of_Services.pdf" target="_blank">Terms of Services</a>.</label>'; // Push the terms above the submit button var submitHTML = document.getElementById("process-save").parentElement .innerHTML; document.getElementById("process-save").parentElement.innerHTML = customerTerms + submitHTML; // Add call back URL field input document.getElementById("applications-shipment_tracking_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idpissuer_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idppuburl_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_recorduri_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); }); // // Conditional contact request // function getContactFields() { // List of all custom fields added in the MashDash Model and Layout for contact request // Three arrays: one for each request dropdown select index var customContactFormFields = [ [], ["contact_request-message"], ["contact_request-api", "contact_request-httpStatus", "contact_request-affected_awb", "contact_request-company_name", "contact_request-complete_received_response", "contact_request-complete_request_body", "contact_request-conversation_id", "contact_request-issue_description", "contact_request-issue_timestamp", "contact_request-type_of_impairment", "contact_request-environment", "contact_request-url_accessed" ] ]; return customContactFormFields; } function getRequiredContactFields() { // List of required fields, ie must have a value. Can include custom and standard fields. // Three arrays: one for each request dropdown select index var requiredContactFields = [ [], ["contact_request-subject", "contact_request-message", "contact_request-name", "contact_request-email" ], ["contact_request-subject", "contact_request-name", "contact_request-email", "contact_request-company_name", "contact_request-type_of_impairment", "contact_request-environment", "contact_request-api", "contact_request-url_accessed", "contact_request-httpStatus", "contact_request-issue_description" ] ]; return requiredContactFields; } function changeContactFieldLabel(labelFor, labelText) { // Change label text var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == labelFor) { elem.innerHTML = labelText; break; } } } function setSubmitState() { // Skip post-submit pages if (!document.getElementById("contact_request-type")) return; // Enables the submit button if all required fields have values var formType = document.getElementById("contact_request-type").selectedIndex; if (formType == 0) { // No type selected document.getElementById("process-submit").disabled = true; } var requiredFields = getRequiredContactFields(); for (var field = 0; field < requiredFields[formType].length; field++) { if (!document.getElementById(requiredFields[formType][field]).value) { document.getElementById("process-submit").disabled = true; return; } } document.getElementById("process-submit").disabled = false; } function setContactFieldRequired(fieldId, required = false) { // Sets field to be required (ie must have a value) or not required) if (required) { document.getElementById(fieldId).parentElement.classList.add("require"); document.getElementById(fieldId).classList.add("require"); } else { document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); } break; } } } function setContactFieldDisplay(fieldId, showField) { // Show/hide form field // Input field: if (showField) { document.getElementById(fieldId).hidden = false; document.getElementById(fieldId).parentElement.style.visibility = "visible"; document.getElementById(fieldId).parentElement.style.fontSize = "100%"; } else { document.getElementById(fieldId).hidden = true; document.getElementById(fieldId).parentElement.style.visibility = "hidden"; document.getElementById(fieldId).parentElement.style.fontSize = "0%"; } // Fields label: var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (showField) { elem.style.visibility = "visible"; elem.parentElement.style.visibility = "visible"; elem.parentElement.style.fontSize = "100%"; } else { elem.style.visibility = "hidden"; elem.parentElement.style.visibility = "hidden"; elem.parentElement.style.fontSize = "0%"; } break; } } } function setCustomLabels(formType) { // Custom label text per form type if (formType == 0) { // Default changeContactFieldLabel('contact_request-subject', 'Subject'); } else { // Not default changeContactFieldLabel('contact_request-subject', 'Issue Title'); } } function setContactFormType() { // Skip post-submit pages if (!document.getElementById("contact_request-type")) return; // Sets all the fields for different contact type selections var formType = document.getElementById("contact_request-type").selectedIndex; // Selected form index // If form type not selected so hide of defaults var defaultFields = ['contact_request-subject','contact_request-name','contact_request-handle','contact_request-email'] for (var defaultField = 0; defaultField < defaultFields.length; defaultField++) { if (formType == 0) { setContactFieldDisplay(defaultFields[defaultField], false); } else { setContactFieldDisplay(defaultFields[defaultField], true); } } var contactFields = getContactFields(); var displayedFieldsProcessed = []; var requiredFieldsProcessed = []; // Loop over all possible form selections for (var form = 0; form < contactFields.length; form++) { var formState = false; if (form == formType) { formState = true; } // Display all fields for this form type for (var contactField = 0; contactField < contactFields[form].length; contactField++) { if (displayedFieldsProcessed.includes(contactFields[form][contactField])) break; setContactFieldDisplay( contactFields[form][contactField], formState); if (form == formType) displayedFieldsProcessed.push(contactFields[form] [contactField]); } // Set required fields var requiredFields = getRequiredContactFields(); for (var requiredField = 0; requiredField < requiredFields[form].length; requiredField++) { if (requiredFieldsProcessed.includes(requiredFields[form][requiredField])) break; setContactFieldRequired( requiredFields[form][requiredField], formState); if (form == formType) requiredFieldsProcessed.push(requiredFields[ form][requiredField]); } } // Set custom labels setCustomLabels(formType); // Clear form when it changes type var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type.toLowerCase() == 'text') { inputs[i].value = ''; } } var textareas = document.getElementsByTagName('textarea'); for (var i = 0; i < textareas.length; i++) { textareas[i].value = ''; } if (formType == 0) { document.getElementById('contact_request-type_of_impairment').selectedIndex = -1; document.getElementById('contact_request-environment').selectedIndex = -1; document.getElementById('contact_request-api').selectedIndex = -1; } document.getElementById("process-submit").disabled = true; } // Conditional contact request window.addEventListener('portalAfterRender', function() { // Only run on contact request page if (!document.getElementById("page-contact")) return; // Skip post-submit pages if (!document.getElementById("contact_request-type")) return; // Set up the form setContactFormType(); setSubmitState(); // Add field onchange listener to be able to enable/disable submit var requiredFields = getRequiredContactFields(); document.getElementById("process-submit").disabled = true; for (var formType = 0; formType < requiredFields.length; formType++) { for (var field = 0; field < requiredFields[formType].length; field++) { document.getElementById(requiredFields[formType][field]).setAttribute( "oninput", "setSubmitState()"); } } // Add request type select onchange document.getElementById("contact_request-type").setAttribute( "onchange", "setContactFormType()"); }); //]]> </script> <script src="/files/main.js" type="text/javascript"></script> <script type="text/javascript" > m$.init(portalOptions); </script> </body> </html>