// JavaScript Document function formRadio(form, radio) { if(radio.id === "radio-primary-contact-gender-male") { if(form.elements[radio.id].checked) { if(document.getElementById('select-primary-contact-title')) { for(var i = 0; i < document.getElementById('select-primary-contact-title').length; i++) { if(document.getElementById('select-primary-contact-title').options[i].value === "Mr.") { document.getElementById('select-primary-contact-title').options[i].selected = true; } } } } } if(radio.id === "radio-primary-contact-gender-female") { if(form.elements[radio.id].checked) { if(document.getElementById('select-primary-contact-title')) { for(var i = 0; i < document.getElementById('select-primary-contact-title').length; i++) { if(document.getElementById('select-primary-contact-title').options[i].value === "Mrs.") { document.getElementById('select-primary-contact-title').options[i].selected = true; } } } } } if(radio.id === "radio-secondary-contact-gender-male") { if(form.elements[radio.id].checked) { if(document.getElementById('select-secondary-contact-title')) { for(var i = 0; i < document.getElementById('select-secondary-contact-title').length; i++) { if(document.getElementById('select-secondary-contact-title').options[i].value === "Mr.") { document.getElementById('select-secondary-contact-title').options[i].selected = true; } } } } } if(radio.id === "radio-secondary-contact-gender-female") { if(form.elements[radio.id].checked) { if(document.getElementById('select-secondary-contact-title')) { for(var i = 0; i < document.getElementById('select-secondary-contact-title').length; i++) { if(document.getElementById('select-secondary-contact-title').options[i].value === "Mrs.") { document.getElementById('select-secondary-contact-title').options[i].selected = true; } } } } } if(radio.id == "radio-preference-mail-1") { if(form.elements[radio.id].checked) { document.getElementById('wrapper-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-government-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-locked-bag-details-form').style.display = 'none'; document.getElementById('wrapper-mailing-address-details-form').style.display = 'none'; } } if(radio.id == "radio-preference-mail-2") { if(form.elements[radio.id].checked) { document.getElementById('wrapper-post-office-box-details-form').style.display = 'block'; document.getElementById('wrapper-government-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-locked-bag-details-form').style.display = 'none'; document.getElementById('wrapper-mailing-address-details-form').style.display = 'none'; } } if(radio.id == "radio-preference-mail-3") { if(form.elements[radio.id].checked) { document.getElementById('wrapper-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-government-post-office-box-details-form').style.display = 'block'; document.getElementById('wrapper-locked-bag-details-form').style.display = 'none'; document.getElementById('wrapper-mailing-address-details-form').style.display = 'none'; } } if(radio.id == "radio-preference-mail-4") { if(form.elements[radio.id].checked) { document.getElementById('wrapper-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-government-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-locked-bag-details-form').style.display = 'block'; document.getElementById('wrapper-mailing-address-details-form').style.display = 'none'; } } if(radio.id == "radio-preference-mail-5") { if(form.elements[radio.id].checked) { document.getElementById('wrapper-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-government-post-office-box-details-form').style.display = 'none'; document.getElementById('wrapper-locked-bag-details-form').style.display = 'none'; document.getElementById('wrapper-mailing-address-details-form').style.display = 'block'; } } }