CINXE.COM

Lufthansa Cargo Developer Portal I/O Docs

<!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 = 'b60cb0b9371731a9fe6b'; //<![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 I/O Docs</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> <script type="text/javascript"> //<![CDATA[ useLatestSwaggerLibrary = 0 //]]> </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-ioDocs" class="page-ioDocs browse en_US"> <!-- PAGE --> <div id="page" class="page browse 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%2Fio-docs&amp;h=0282acd2ff013ab1de649f595d10f744">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> I/O Docs: API Documentation</h1> <div class="introText"> <p>Test our API services using I/O Docs. You can also view our <a href="/docs">written documentation</a>.</p></div> <div class="services servicesIodocs"> <div class="typeahead-wrapper"> <div class="typeahead"> <input id="apiIdInput" class="typeahead-input" placeholder="Select an Interactive Documentation" autocomplete="off"> <span class="down-icon"></span> </div> <div id="typeaheadSuggestions" class="typeahead-suggestions"> <ul id="typeaheadUL" class="typeahead-items"> <li class="typeahead-item" data-value="" data-name="Select an Interactive Documentation">Select an Interactive Documentation</li> <li class="typeahead-item" data-name="Routing Offer API" data-value="27094" data-doc-type="SWAGGER"> Routing Offer API </li> <li class="typeahead-item" data-name="Shipment Tracking API" data-value="29600" data-doc-type="SWAGGER"> Shipment Tracking API </li> <li class="typeahead-item" data-name="Shipment Tracking Subscribe API" data-value="27093" data-doc-type="SWAGGER"> Shipment Tracking Subscribe API </li> <li class="typeahead-item" data-name="Station Information" data-value="29325" data-doc-type="SWAGGER"> Station Information </li> </ul> </div> <div id="selectWrapperHidden"> <span id="apiTitle"></span> <select name="apiId" id="apiId"> <option value="">Select an Interactive Documentation</option> <option value="27094" data-doc-type="SWAGGER" >Routing Offer API</option> <option value="29600" data-doc-type="SWAGGER" >Shipment Tracking API</option> <option value="27093" data-doc-type="SWAGGER" >Shipment Tracking Subscribe API</option> <option value="29325" data-doc-type="SWAGGER" >Station Information</option> </select> </div> </div> </div> <style> .servicesIodocs { overflow: visible; } .typeahead-wrapper { position: relative; width: 500px; } .typeahead { position: relative; } .typeahead-input { width: 100%; padding: 6px 30px 6px 6px; font-size: 16px; box-sizing: border-box; } .down-icon { position: absolute; top: 50%; margin-top: -4px; right: 8px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #000; pointer-events: none; } div#content{ overflow: visible; } li.typeahead-item { margin: 0; padding: 5px; font-size: 16px; cursor: pointer; } li.typeahead-item:hover { background-color: #8a8a8a; } #selectWrapperHidden, #apiId{ display: none; } .typeahead-suggestions{ box-sizing: border-box; width: 100%; position: absolute; top: 100%; left: 0px; border: 1px solid grey; border-radius: 3px; display: none; background-color: rgb(204, 204, 204); padding: 5px; z-index: 2; overflow: auto; height: 200px; } </style> <script > (function() { function onReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } } onReady(function() { var selectDefaultText = "Select an Interactive Documentation"; var apiId = document.getElementById('apiId'); var apiIdInput = document.getElementById('apiIdInput'); var typeaheadUL = document.getElementById('typeaheadUL'); var typeaheadSuggestions = document.getElementById('typeaheadSuggestions'); var initialItems = Array.prototype.slice.call(typeaheadUL.children); apiIdInput.addEventListener('click', function(event) { event.stopPropagation(); typeaheadSuggestions.style.display = 'block'; }); document.addEventListener('click', function(event) { typeaheadSuggestions.style.display = 'none'; }); typeaheadUL.addEventListener('click', function(event) { typeaheadSuggestions.style.display = 'none'; if(event.target.getAttribute('data-name') === selectDefaultText) { updateFilterItems({target: {value: ''}}); apiIdInput.value = ''; } else { apiIdInput.value = event.target.getAttribute('data-name'); } apiId.value = event.target.getAttribute('data-value'); apiId.dispatchEvent(new CustomEvent('change', { bubbles: true, cancelable: true, detail: apiId })); }, false); var updateFilterItems = function(event) { var filteredItems = initialItems.filter(function(item) { if(item.attributes.getNamedItem('data-name').value.toLowerCase() === selectDefaultText.toLowerCase()) { return true; } else { return item.attributes.getNamedItem('data-name').value.toLowerCase().search(event.target.value.toLowerCase()) !== -1; } }); typeaheadUL.innerHTML = ''; filteredItems.forEach(function(element) { typeaheadUL.append(element); }); }; apiIdInput.addEventListener('input', updateFilterItems); var selectedOption = apiId.options[apiId.selectedIndex]; apiIdInput.value = (selectedOption.text == selectDefaultText && selectedOption.value == "") ? apiId[1].text : selectedOption.text; apiId.value = (selectedOption.text == selectDefaultText && selectedOption.value == "") ? apiId[1].value : selectedOption.value; apiId.dispatchEvent(new CustomEvent('change', { bubbles: true, cancelable: true, detail: apiId })); }); })(); </script> <!-- Swagger container --> <div id="swagger" style="display:none"> <button class="swagger-download-spec"> <svg xmlns="http://www.w3.org/2000/svg" role="img" style="height:1em;width:1em;" viewBox="0 0 92 92" aria-labelledby="download-spec-title"><title id="download-spec-title">Download Specification</title><path fill="currentColor" d="M89 58.8V86c0 2.8-2.2 5-5 5H8c-2.8 0-5-2.2-5-5V58.8c0-2.8 2.2-5 5-5s5 2.2 5 5V81h66V58.8c0-2.8 2.2-5 5-5s5 2.2 5 5zM42.4 65c.9 1 2.2 1.5 3.6 1.5s2.6-.5 3.6-1.5l19.9-20.4c1.9-2 1.9-5.1-.1-7.1-2-1.9-5.1-1.9-7.1.1L51 49.3V6c0-2.8-2.2-5-5-5s-5 2.2-5 5v43.3L29.6 37.7c-1.9-2-5.1-2-7.1-.1s-2 5.1-.1 7.1l20 20.3z"/></svg> </button> <div id="swagger-ui"></div> </div> <!-- Files related to IO-Docs --> <input type="hidden" name="enable_high_security_secret_management" value="" /> </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="active "><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">&nbsp;</div> <div id="extra2">&nbsp;</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>

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