Field Definitions: This is the area where you define the fields ----------------------------------------------------------------------------------- Captcha Access Section ----------------------------------------------------------------------------------- Requestor Identify Section Hidden field and rule for normalizing the phone number ----------------------------------------------------------------------------------- DoD Organizational Affiliation Section Us DOD Activity Code DoD Contractor PreDefined Organizations DoD Contractor Additional Fields Rules to Hide and Show addition fields ---------------------------------------------------------------------------------- Sponsoring Activity Section ------------------------------------------------------------------------------------ Multi Factor Authentication type -------------------------------------------------------------------------------------- CAC Fields -------------------------------------------------------------------------------------- Cybersecurity Training Certificate Section ------------------------------------------------------------------------------------ IP Catcher -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Below is where the Fields are shown on the page.
|
<style> span[class^='i_holdingrow_'] label { width: 150px; max-width: 250px; display: inline-block; vertical-align: baseline; } span[id^='i_holdingrow_EntityType'] label { width: 500px; max-width: 500px; padding-left: 10px; } select[id^='i_OrgSelection'] { width: 300px !important; max-width: 500px !important; } label[id^='i_labelfor_MultiFactor'] { width: 300px !important; max-width: 500px !important; } label[id^='i_labelfor_fillCacInfo'], label[id^='i_labelfor_cacFetchStatus'] { width: auto !important; max-width: 500px !important; padding-right: 10px !important; vertical-align: baseline; } label[id^='i_labelfor_DoDOrgAffiliation'] { width: auto !important; padding-right: 10px !important; } .flex-container { display: flex; flex-wrap: wrap; align-items: flex-start; } .flex-item-left { flex-grow: 0; padding-right: 20px; } .flex-item-mid { flex-grow: 1; padding-right: 20px; } .flex-item-right { flex-grow: 8; padding-right: 20px; } @media only screen and (max-width: 1427px) { .flex-item-right { padding-top: 20px; } } </style> |
<script> function formatPhoneNumber(phoneNumberString) { var match = phoneNumberString.match( /^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/, ); if (match) { return `${match[1] ? '+' + match[1] + ' ' : ''}(${match[2]}) ${match[3]}-${match[4]}`; } return ''; } function setPhoneNumberValue(formName, formId) { AJS.$(formName) .find('#i_PhoneNumberFormatted') .val(formatPhoneNumber(AJS.$(formName).find('#i_PhoneNumber').val())); } AJS.$('#rw_search_container').hide(); </script> |
<script> const getCacURL = 'https://clientcert.secure.mafdmo.com/client-cert-api'; async function fetchCacInfo() { let done = false; let fetchResult = { cacInfo: undefined, retryCount: 0 }; console.log('Starting fetch operation some more...'); while (!done && fetchResult.retryCount < 10) { console.log(`Fetching CAC info: ${fetchResult.retryCount}`); const response = await fetch(getCacURL, { credentials: 'include', mode: 'cors', }).catch((reason) => { console.error('fetch() promise failed:'); console.error(reason); return undefined; }); if (response) { await response .json() .then((value) => { fetchResult = { ...fetchResult, cacInfo: value }; const cacInfoStr = JSON.stringify(value, null, 2); console.log('cacInfo:'); console.log(cacInfoStr); done = true; }) .catch((reason) => { console.error('response.json() promise failed:'); console.error(reason); }); } fetchResult.retryCount++; } if (!done) { console.log(`Fetch not done after ${fetchResult.retryCount} retries`); } console.log(JSON.stringify(fetchResult, null, 2)); return fetchResult; } async function getCacInfo(formName, formId) { if (!formName) return; let fetchResult; cfSetValueWithEventPropagation(formId, 'cacFetchStatus', 'Fetching user information from CAC...'); try { fetchResult = await fetchCacInfo(); } catch (e) { cfSetValueWithEventPropagation(formId, 'cacFetchStatus', 'Failure accessing CAC certificate.'); console.error('Error: '); console.error(JSON.stringify(e, null, 2)); return; } console.log('fetchResult:'); console.log(JSON.stringify(fetchResult, null, 2)); if (fetchResult.cacInfo !== undefined) { cfSetValueWithEventPropagation(formId, 'cacSubject', fetchResult.cacInfo.subject); cfSetValueWithEventPropagation(formId, 'cacJSON', JSON.stringify(fetchResult.cacInfo, null, 2)); cfSetValueWithEventPropagation( formId, 'cacFetchStatus', 'CAC user info successfully retrieved.', ); } else { cfSetValueWithEventPropagation( formId, 'cacFetchStatus', `Failure retrieving CAC information after ${fetchResult.retryCount} tries`, ); } } </script> |