However, I also need to make the 'grant_mailbox_access' field mandatory (required) whenever it is displayed and not required when it's hidden.
I don't know what javascript method/function to use to manipulate this widget's required attribute.
TIA
<code snippet>
- Code: Select all
function hideFields() {
var successor = document.getElementById('successor_id').value;
if (successor.length == 0){
document.getElementById('grant_mailbox_access').style.display = 'none';
document.getElementById('grant_mailbox_access_form_row').style.display = 'none';
}
else
{
document.getElementById('grant_mailbox_access').style.display = '';
document.getElementById('grant_mailbox_access_form_row').style.display = '';
}
}
</code snippet>