Last active
April 4, 2022 07:47
-
-
Save mdailey77/9f9423477b24de838251a6636a9f300d to your computer and use it in GitHub Desktop.
A customized checkbox tree structure in a preference center form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var PrefFieldsArray = ['Pref_ThoughtLeadership_HPInsight', 'Pref_Solutions_BusinessIntelligence', 'Pref_Solutions_CloudComputing', 'Pref_Solutions_Virtualization', 'Pref_Solutions_DataCenter', 'Pref_Solutions_ConvgdInfra', 'Pref_Solutions_UnifiedComms', 'Pref_Solutions_AppTransfrmtn', 'Pref_Solutions_EntPrintMoblty', 'Pref_Solutions_EntSecurity', | |
'Pref_Solutions_InfoMgmt', 'Pref_Solutions_Sustainblty', 'Pref_Solutions_GraphicArts', 'Pref_Solutions_Telecmmting', 'Pref_Solutions_WirelessLANNetwrkg', 'Pref_Solutions_SDN', 'Pref_Services_ITOutsourcing', 'Pref_Services_BusProcOutsrcing', 'Pref_Services_AppSvcs', 'Pref_Services_SpprtNewIT_FndtnCare', 'Pref_Services_SpprtNewIT_ProactvCare', | |
'Pref_Services_SpprtNewIT_DatactrCare', 'Pref_Services_ConsltSvcs_ConvgdInfra', 'Pref_Services_ConsltSvcs_Cloud', 'Pref_Services_ConsltSvcs_BigData', 'Pref_Services_ConsltSvcs_Mobility', 'Pref_Services_ConsltSvcs_Network', 'Pref_Services_ConsltSvcs_Storage', 'Pref_Services_ConsltSvcs_Server', 'Pref_Services_MngdPrintSvcs', 'Pref_ITInfrastructure_ITAppMgmtSoftware', | |
'Pref_ITInfrastructure_AppsDevSoftware', 'Pref_ITInfrastructure_Servers_HPIntegrity', 'Pref_ITInfrastructure_Servers_ProLiantBlades', 'Pref_ITInfrastructure_Servers_ProLiantRack', 'Pref_ITInfrastructure_Servers_ProLiantDensity', 'Pref_ITInfrastructure_Servers_PerfMoonshot', 'Pref_ITInfrastructure_Storage_VirtCloud', 'Pref_ITInfrastructure_Storage_BusApps', 'Pref_ITInfrastructure_Storage_BURA', | |
'Pref_ITInfrastructure_Storage_Other', 'Pref_ITInfrastructure_Netwrkg_DataCenter', 'Pref_ITInfrastructure_Netwrkg_CampusBranch', 'Pref_ITInfrastructure_Netwrkg_BYODevice', 'Pref_ITInfrastructure_PersonalMobileCmptg', 'Pref_ITInfrastructure_Printing']; | |
jQuery(document).ready(function($) { | |
$('#preferenceCenter').submit(function(){ | |
var PrefFieldsSelected = $('#preferences').jstree('get_selected'); | |
var PrefSelectedArray = new Array(); | |
for (z = 0; z < PrefFieldsSelected.length; z++) { | |
PrefSelectedArray.push(hpPrefFieldsSelected[z].slice(0, -3)); | |
} | |
for (x = 0; x < PrefSelectedArray.length; x++) { | |
for (var y = 0; y < PrefFieldsArray.length; y++) { | |
if (PrefSelectedArray[x] === PrefFieldsArray[y]) { | |
$('#' + PrefSelectedArray[x] + 'ID').val('Y'); | |
} else { | |
// do nothing | |
} | |
} | |
} | |
//return false; | |
}); | |
// jsTree jQuery plugin | |
$('#preferences').jstree({ | |
"core" : { | |
"theme" : { | |
"icon" : false | |
}, | |
"animation" : false | |
}, | |
"checkbox" : { | |
"keep_selected_style" : false | |
}, | |
"plugins" : [ "wholerow", "checkbox" ] | |
}); | |
// performs data lookup in custom data object and populates preference center checkboxes | |
PreferencesLookup(); | |
jQuery('a#notYou').click(function(event){ | |
event.preventDefault(); | |
window.location.replace(signupURL); | |
}); | |
}); | |
function PrefLookup(){ | |
if(GetElqContentPersonalizationValue || this.GetElqContentPersonalizationValue){ | |
for (x = 0; x < PrefFieldsArray.length; x++) { | |
$valueCheck = GetElqContentPersonalizationValue(PrefFieldsArray[x] + '1') | |
if ($valueCheck == 'Y') { | |
jQuery.jstree.reference('#preferences').select_node(PrefFieldsArray[x] + 'Box'); | |
} | |
} | |
} | |
} | |
function PreferencesLookup() { | |
//Checks the custom data object using the HP_Preference_Center_Lookup | |
script = getElqScriptUrl(escape('0c5a056671344dda960044d974a53906'),'<Email_Address1>' + prefLookupEmail + '</Email_Address1>'); | |
jQuery.getScript( script, function(){ | |
PrefLookup(); | |
}); | |
} | |
</script> | |
<div id="preferencesHolder"> | |
<h3>Preference Center</h3> | |
<form action="[Eloqua form submission URL]" name="preferenceCenter" id="preferenceCenter" method="post"> | |
<!-- start of hidden preference form fields --> | |
<input type="hidden" name="Pref_ThoughtLeadership_HPInsight" id="Pref_ThoughtLeadership_HPInsightID" value="N"> | |
<input type="hidden" name="Pref_Solutions_BusinessIntelligence" id="Pref_Solutions_BusinessIntelligenceID" value="N"> | |
<input type="hidden" name="Pref_Solutions_CloudComputing" id="Pref_Solutions_CloudComputingID" value="N"> | |
<input type="hidden" name="Pref_Solutions_Virtualization" id="Pref_Solutions_VirtualizationID" value="N"> | |
<input type="hidden" name="Pref_Solutions_DataCenter" id="Pref_Solutions_DataCenterID" value="N"> | |
<input type="hidden" name="Pref_Solutions_ConvgdInfra" id="Pref_Solutions_ConvgdInfraID" value="N"> | |
<input type="hidden" name="Pref_Solutions_UnifiedComms" id="Pref_Solutions_UnifiedCommsID" value="N"> | |
<input type="hidden" name="Pref_Solutions_AppTransfrmtn" id="Pref_Solutions_AppTransfrmtnID" value="N"> | |
<input type="hidden" name="Pref_Solutions_EntPrintMoblty" id="Pref_Solutions_EntPrintMobltyID" value="N"> | |
<input type="hidden" name="Pref_Solutions_EntSecurity" id="Pref_Solutions_EntSecurityID" value="N"> | |
<input type="hidden" name="Pref_Solutions_InfoMgmt" id="Pref_Solutions_InfoMgmtID" value="N"> | |
<input type="hidden" name="Pref_Solutions_Sustainblty" id="Pref_Solutions_SustainbltyID" value="N"> | |
<input type="hidden" name="Pref_Solutions_GraphicArts" id="Pref_Solutions_GraphicArtsID" value="N"> | |
<input type="hidden" name="Pref_Solutions_Telecmmting" id="Pref_Solutions_TelecmmtingID" value="N"> | |
<input type="hidden" name="Pref_Solutions_WirelessLANNetwrkg" id="Pref_Solutions_WirelessLANNetwrkgID" value="N"> | |
<input type="hidden" name="Pref_Solutions_SDN" id="Pref_Solutions_SDNID" value="N"> | |
<input type="hidden" name="Pref_Services_ITOutsourcing" id="Pref_Services_ITOutsourcingID" value="N"> | |
<input type="hidden" name="Pref_Services_BusProcOutsrcing" id="Pref_Services_BusProcOutsrcingID" value="N"> | |
<input type="hidden" name="Pref_Services_AppSvcs" id="Pref_Services_AppSvcsID" value="N"> | |
<input type="hidden" name="Pref_Services_SpprtNewIT_FndtnCare" id="Pref_Services_SpprtNewIT_FndtnCareID" value="N"> | |
<input type="hidden" name="Pref_Services_SpprtNewIT_ProactvCare" id="Pref_Services_SpprtNewIT_ProactvCareID" value="N"> | |
<input type="hidden" name="Pref_Services_SpprtNewIT_DatactrCare" id="Pref_Services_SpprtNewIT_DatactrCareID" value="N"> | |
<input type="hidden" name="Pref_Services_ConsltSvcs_ConvgdInfra" id="Pref_Services_ConsltSvcs_ConvgdInfraID" value="N"> | |
<input type="hidden" name="Pref_Services_ConsltSvcs_Cloud" id="Pref_Services_ConsltSvcs_CloudID" value="N"> | |
<input type="hidden" name="Pref_Services_ConsltSvcs_BigData" id="Pref_Services_ConsltSvcs_BigDataID" value="N"> | |
<input type="hidden" name="Pref_Services_ConsltSvcs_Mobility" id="Pref_Services_ConsltSvcs_MobilityID" value="N"> | |
<input type="hidden" name="Pref_Services_ConsltSvcs_Network" id="Pref_Services_ConsltSvcs_NetworkID" value="N"> | |
<input type="hidden" name="Pref_Services_ConsltSvcs_Storage" id="Pref_Services_ConsltSvcs_StorageID" value="N"> | |
<input type="hidden" name="Pref_Services_ConsltSvcs_Server" id="Pref_Services_ConsltSvcs_ServerID" value="N"> | |
<input type="hidden" name="Pref_Services_MngdPrintSvcs" id="Pref_Services_MngdPrintSvcsID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_ITAppMgmtSoftware" id="Pref_ITInfrastructure_ITAppMgmtSoftwareID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_AppsDevSoftware" id="Pref_ITInfrastructure_AppsDevSoftwareID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Servers_HPIntegrity" id="Pref_ITInfrastructure_Servers_HPIntegrityID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Servers_ProLiantBlades" id="Pref_ITInfrastructure_Servers_ProLiantBladesID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Servers_ProLiantRack" id="Pref_ITInfrastructure_Servers_ProLiantRackID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Servers_ProLiantDensity" id="Pref_ITInfrastructure_Servers_ProLiantDensityID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Servers_PerfMoonshot" id="Pref_ITInfrastructure_Servers_PerfMoonshotID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Storage_VirtCloud" id="Pref_ITInfrastructure_Storage_VirtCloudID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Storage_BusApps" id="Pref_ITInfrastructure_Storage_BusAppsID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Storage_BURA" id="Pref_ITInfrastructure_Storage_BURAID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Storage_Other" id="Pref_ITInfrastructure_Storage_OtherID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Netwrkg_DataCenter" id="Pref_ITInfrastructure_Netwrkg_DataCenterID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Netwrkg_CampusBranch" id="Pref_ITInfrastructure_Netwrkg_CampusBranchID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Netwrkg_BYODevice" id="Pref_ITInfrastructure_Netwrkg_BYODeviceID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_PersonalMobileCmptg" id="Pref_ITInfrastructure_PersonalMobileCmptgID" value="N"> | |
<input type="hidden" name="Pref_ITInfrastructure_Printing" id="Pref_ITInfrastructure_PrintingID" value="N"> | |
<!-- end of hidden preference form fields --> | |
<div class="clear"></div> | |
<br> | |
<div id="preferences"> | |
<ul> | |
<li> | |
<span class="section_header">Thought Leadership</span> | |
<ul> | |
<li id="Pref_ThoughtLeadership_InsightBox">HPE Insight, Point-of-View, Emerging Trends and Analyst Reports</li> | |
</ul> | |
</li> | |
<li><span class="section_header">Solutions</span> | |
<ul> | |
<li id="Pref_Solutions_BusinessIntelligenceBox">Business Intelligence, OLTP, Data Warehousing, Information Optimization</li> | |
<li id="Pref_Solutions_CloudComputingBox">Cloud Computing (Private, Hybrid, Public)</li> | |
<li id="Pref_Solutions_VirtualizationBox">Virtualization (Server, Storage, Client, Network)</li> | |
<li id="Pref_Solutions_DataCenterBox">Data Center Transformation/Converged Infrastructure</li> | |
<li id="Pref_Solutions_ConvgdInfraBox">Converged Infrastructure</li> | |
<li id="Pref_Solutions_UnifiedCommsBox">Unified Communications (voice, video, and data on the same network)</li> | |
<li id="Pref_Solutions_AppTransfrmtnBox">Application Transformation</li> | |
<li id="Pref_Solutions_EntPrintMobltyBox">Enterprise and Printing Mobility</li> | |
<li id="Pref_Solutions_EntSecurityBox">Enterprise Security</li> | |
<li id="Pref_Solutions_InfoMgmtBox">Information Management/Document Management</li> | |
<li id="Pref_Solutions_SustainbltyBox">Sustainability and Environmental Responsibility</li> | |
<li id="Pref_Solutions_GraphicArtsBox">Graphic Arts and Production Printing</li> | |
<li id="Pref_Solutions_TelecmmtingBox">Telecommuter and Remote/Branch Office</li> | |
<li id="Pref_Solutions_WirelessLANNetwrkgBox">Wireless LAN/Wireless Networking</li> | |
<li id="Pref_Solutions_SDNBox">Software Defined Networking (SDN)</li> | |
</ul> | |
</li> | |
<li><span class="section_header">Services</span> | |
<ul> | |
<li id="Pref_Services_ITOutsourcingBox">IT Outsourcing</li> | |
<li id="Pref_Services_BusProcOutsrcingBox">Business Process Outsourcing</li> | |
<li id="Pref_Services_AppSvcsBox">Application Services</li> | |
<li>Support for the New Style of IT | |
<ul> | |
<li id="Pref_Services_SpprtNewIT_FndtnCareBox">Foundation Care</li> | |
<li id="Pref_Services_SpprtNewIT_ProactvCareBox">Proactive Care</li> | |
<li id="Pref_Services_SpprtNewIT_DatactrCareBox">Datacenter Care</li> | |
</ul> | |
</li> | |
<li>Consulting Services | |
<ul> | |
<li id="Pref_Services_ConsltSvcs_ConvgdInfraBox">Converged Infrastructure Consulting</li> | |
<li id="Pref_Services_ConsltSvcs_CloudBox">Cloud Consulting</li> | |
<li id="Pref_Services_ConsltSvcs_BigDataBox">Big Data Consulting</li> | |
<li id="Pref_Services_ConsltSvcs_MobilityBox">Mobility Consulting</li> | |
<li id="Pref_Services_ConsltSvcs_NetworkBox">Network Services</li> | |
<li id="Pref_Services_ConsltSvcs_StorageBox">Storage Services</li> | |
<li id="Pref_Services_ConsltSvcs_ServerBox">Server Services</li> | |
</ul> | |
</li> | |
<li id="Pref_Services_MngdPrintSvcsBox">Managed Print Services</li> | |
</ul> | |
</li> | |
<li><span class="section_header">IT Infrastructure, Hardware and Software</span> | |
<ul> | |
<li id="Pref_ITInfrastructure_ITAppMgmtSoftwareBox">IT Application, Infrastructure and Operations Management Software</li> | |
<li id="Pref_ITInfrastructure_AppsDevSoftwareBox">Applications Test and Development Software</li> | |
<li>Servers | |
<ul> | |
<li id="Pref_ITInfrastructure_Servers_HPIntegrityBox">HPE Integrity Server portfolio</li> | |
<li id="Pref_ITInfrastructure_Servers_ProLiantBladesBox">HPE ProLiant Server Blades</li> | |
<li id="Pref_ITInfrastructure_Servers_ProLiantRackBox">HPE ProLiant Rack and Tower</li> | |
<li id="Pref_ITInfrastructure_Servers_ProLiantDensityBox">HPE ProLiant Density-Optimized</li> | |
<li id="Pref_ITInfrastructure_Servers_PerfMoonshotBox">High Performance Computing/HPE Moonshot</li> | |
</ul> | |
</li> | |
<li>Storage Products and Solutions | |
<ul> | |
<li id="Pref_ITInfrastructure_Storage_VirtCloudBox">Storage for Virtualization and Cloud</li> | |
<li id="Pref_ITInfrastructure_Storage_BusAppsBox">Storage for Business Applications (Microsoft, SAP, Oracle, Citrix)</li> | |
<li id="Pref_ITInfrastructure_Storage_BURABox">Backup, Recovery and Archive Solutions</li> | |
<li id="Pref_ITInfrastructure_Storage_OtherBox">Other Storage Systems and Services</li> | |
</ul> | |
</li> | |
<li>Networking Products and Services | |
<ul> | |
<li id="Pref_ITInfrastructure_Netwrkg_DataCenterBox">Data Center Networking/core switching and routing</li> | |
<li id="Pref_ITInfrastructure_Netwrkg_CampusBranchBox">Campus-branch networking/edge of network switching</li> | |
<li id="Pref_ITInfrastructure_Netwrkg_BYODeviceBox">Network Management/Bring Your Own Device (BYOD)</li> | |
</ul> | |
</li> | |
<li id="Pref_ITInfrastructure_PersonalMobileCmptgBox">Personal and Mobile Computing and Workstations</li> | |
<li id="Pref_ITInfrastructure_PrintingBox">Printing Hardware and Software</li> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
<a tabindex="250" class="button_hpe inline primary png"><input title="Submit" value="Submit" type="submit"></a> | |
</form> | |
</div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment