function eventtypechange()
{
var m =Xrm.Page.getAttribute("typecode").getValue();
if(m==3)
{
Xrm.Page.getAttribute("msa_street1").setRequiredLevel("required");
Xrm.Page.getAttribute("msa_stateprovince").setRequiredLevel("required");
Xrm.Page.getAttribute("msa_city").setRequiredLevel("required");
Xrm.Page.getAttribute("msa_zippostalcode").setRequiredLevel("required");

}
else
{
Xrm.Page.getAttribute("msa_street1").setRequiredLevel("none");
Xrm.Page.getAttribute("msa_stateprovince").setRequiredLevel("none");
Xrm.Page.getAttribute("msa_city").setRequiredLevel("none");
Xrm.Page.getAttribute("msa_zippostalcode").setRequiredLevel("none");
}
}

SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012