Hey I have two fields
1) Job title : Option set that include an option"others"
2) Other Job title : Single Text
when the user choose others, the "other job title" should be set as mandatory otherwise if he chooses one of the options it should be read only.
I used the following code but it's giving me an error.. Any suggestion?
//if the user chooses from the option other job title
//enable other job title field
//make other job title mandatory
//else if the user chooses one of the options make other job title read only
function EnableOtherJobTitle()
var jobtitle= Xrm.Page.getAttribute("new_jobtitle").getSelectedOption().value;
alert(jobtitle);
if (jobtitle ==100,000,004)
{
Xrm.Page.getAttribute("new_otherjob").setRequiredLevel("required");
}
else
{
Xrm.Page.ui.controls.get("new_otherjob").setDisabled(true);
}
}
*This post is locked for comments