var select_html = ''; // Establish onload event. old_onload = window.onload; window.onload = function(){ if (typeof(old_onload) == 'function') old_onload(); loadForm(); } function loadForm() { loadEducationLevels(); loadPrograms(); } function loadEducationLevels() { // Load education levels and education level priority table. $.ajax({ url: service_url + '/cdm/clients/ECE0001/educationlevels', type: 'get', dataType: 'json', timeout: 5000, success: function(data){ var options = select_html; var edu = data.body; for (var i = 0; i < edu.length; i++) { options += ''; } $('#education_level_code').html(options); $('#education_level_code').attr('disabled', false); } }); } function loadPrograms() { // Load program data. $.ajax({ url: service_url + '/cdm/clients/ECE0001/programs', type: 'get', dataType: 'json', timeout: 5000, success: function(data){ var options = select_html; pro = data.body; options += ''; for (var i = 0; i < pro.length; i++) { options += ''; } options += ''; $('#program_code').html(options); $('#program_code').attr('disabled', false); } }); } function validateHider(e) { var self = e.objRef; var parent = e.objRef.parentNode; var gparent = e.objRef.parentNode.parentNode; if (self.style.display != 'none' && parent.style.display != 'none' && gparent.style.display != 'none') { e.type = e.objRef.type; return DtmkValidator.runValidate(e); } else { return true; } } function confirmEmail(f) { if (f.email.value == f.conf_email.value) return true; else { alert('Email addresses do not match.'); return false; } } function zipFormat(f) { if (f.country.value == 'USA' || f.country.value == '') { document.getElementById('zip_format_usa').style.display = 'inline'; document.getElementById('zip_format_can').style.display = 'none'; } else if (f.country.value == 'CAN') { document.getElementById('zip_format_usa').style.display = 'none'; document.getElementById('zip_format_can').style.display = 'inline'; } else { document.getElementById('zip_format_usa').style.display = 'none'; document.getElementById('zip_format_can').style.display = 'none'; } } function openWindow(name,url,width,height,scrollbar) { var assetWindow = window.open(url,name,'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=' + scrollbar + ',resizable=0,width=' + width + ',height=' + height); if(window.focus) { assetWindow.focus(); } }