CINXE.COM

Lufthansa Cargo Developer Portal - How to connect

<!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 = '0adac4b6c61f28080f6b'; //<![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 - How to connect</title> <link rel="alternate" type="application/rss+xml" href="https://developer.lufthansa-cargo.com/docs/feed-comments/howtoconnect" /> <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 src="/public/Mashery/scripts/Mashery/source/ForumPreview.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-docs" class="page-docs read en_US"> <!-- PAGE --> <div id="page" class="page read"> <!-- 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%2Fdocs%2Fread%2Fhowtoconnect&amp;h=e7635897586eabe254d9d4e0428417fd">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"> <ul class="pun-nav last"><li class="previous"><span class="label">Previous:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/Home">Lufthansa Cargo API Portfolio and its functionalities</a></li><li class="up"><span class="label">Up:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/Home">Lufthansa Cargo API Portfolio and its functionalities</a></li><li class="next"><span class="label">Next:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis">Public APIs</a></li></ul> <h1 class="first">How to connect</h1> <div class="section"> <div class="section-body"> <p>It is very easy to connect to our API's!</p> <h2>Follow these steps:</h2> <ol> <li>Apply for a key <a href="/member/register">here</a>. Please select the APIs you would like to use in our registration form.</li> <li>Setup the connection to our API gateway.</li> <li>Try the API.&nbsp;</li> </ol> <h2>Apply for a key</h2> <p>To use our API you must first register an application and apply for a key. You will get a key: it is a shared secret that identifies you as a developer. A valid key must be sent with every request. You may ask for more than one key, but to get started, one key will suffice. Please contact us in this case. Subscribing to our API service will allow you to make a limited number of requests to the API. This should be enough to explore the API and its content. Once you develop an application for serious use, contact us to discuss raising your call quota.</p> <h2>Setup the connection to our API gateway</h2> <p>Our API is a collection of RESTful and SOAP web services. You interact with our resources by sending an HTTP message to a URL. The URL determines the resource and for RESTful services the HTTP method defines the type of action. The path determines whether you access the test or production environment.</p> <p>Schema, host and port (443) are always the same:</p> <pre><code>https://api.lufthansa-cargo.com </code></pre> <p>This key must be sent as a HTTP header like this:</p> <pre><code>APIKEY: {yourApiKey}</code></pre> <h2>Try the API</h2> <p>After you received your key and installed the connection, you can try our API. A complete example request looks like this:</p> <pre><code>GET /lh/handling/shipment?aWBPrefix=020&amp;aWBNumber=11111111 HTTP/1.1 Host: api.lufthansa-cargo.com APIKEY: ZmUXXXXXXXXXXXXWFj</code></pre> <h2>ONE Record API</h2> <p>To connect with our ONE Record API please refere to our <a href="/docs/read/prioragreementapis/onerecord">ONE Record Documentation</a>.</p> <h2>Operational Issues</h2> <p>In case of any issues in using our APIs, please use our template for "Operational Issues" at our&nbsp;<a href="/contact">contact</a>&nbsp;page. This template will help you to submit all relevant information.</p> </div> <div class="section-meta"> <p> <span class="revision">version 17</span> <span class="timestamp">as of <abbr title="3/11/24 9:07 am">8 months ago</abbr></span> <span class="moniker">by <span class="user-reference">Florian Goertz</span></span></p> </div> <ul class="pun-nav last"><li class="previous"><span class="label">Previous:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/Home">Lufthansa Cargo API Portfolio and its functionalities</a></li><li class="up"><span class="label">Up:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/Home">Lufthansa Cargo API Portfolio and its functionalities</a></li><li class="next"><span class="label">Next:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis">Public APIs</a></li></ul> </div> <div class="comments"> <h3> 0 Comments </h3> <p><a href="https://developer.lufthansa-cargo.com/login/login?r=https%3A%2F%2Fdeveloper.lufthansa-cargo.com%2Fdocs%2Fread%2Fhowtoconnect&amp;h=e7635897586eabe254d9d4e0428417fd">Please sign in to post a comment.</a></p> </div> </div><!-- /main --> <!-- SUB --> <div id="sub" class="sub"> <h2>Docs Navigation</h2> <ul> <li class="active"><a href="https://developer.lufthansa-cargo.com/docs/read/Home">Lufthansa Cargo API Portfolio and its functionalities</a></li> <li class="active"><a href="https://developer.lufthansa-cargo.com/docs/read/howtoconnect" class="active">How to connect</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis">Public APIs</a><ul> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis/shipmenttracking">Shipment Tracking</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis/shipmenttrackingsubscribe">Shipment Tracking Subscribe</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis/routingoffer">Routing Offer</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis/stationinformation">Station Information</a></li> </ul> </li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis">Prior Agreement APIs</a><ul> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis/uldstatus">ULD Status</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis/smartbooking">smartBooking</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis/onerecord">ONE Record</a></li> </ul> </li> </ul> </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="active "><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">&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