Option set values reading and filtering the fields
function registrationpayment()
{
var detailamt= Xrm.Page.getAttribute("new_paymentmode").getValue();
if(detailamt==null)
{
Xrm.Page.getControl("new_receivedperson").setVisible(false);
Xrm.Page.getControl("new_bankname").setVisible(false);
Xrm.Page.getControl("new_checknumber").setVisible(false);
Xrm.Page.getControl("new_demanddraftnumber").setVisible(false);
Xrm.Page.getControl("new_bankaccountnumber").setVisible(false);
}
if(detailamt==100000000)
{
Xrm.Page.getControl("new_receivedperson").setVisible(true);
Xrm.Page.getControl("new_bankname").setVisible(false);
Xrm.Page.getControl("new_checknumber").setVisible(false);
Xrm.Page.getControl("new_demanddraftnumber").setVisible(false);
Xrm.Page.getControl("new_bankaccountnumber").setVisible(false);
}
if(detailamt==100000001)
{
Xrm.Page.getControl("new_receivedperson").setVisible(false);
Xrm.Page.getControl("new_bankname").setVisible(true);
Xrm.Page.getControl("new_checknumber").setVisible(true);
Xrm.Page.getControl("new_demanddraftnumber").setVisible(false);
Xrm.Page.getControl("new_bankaccountnumber").setVisible(false);
}
if(detailamt==100000002)
{
Xrm.Page.getControl("new_receivedperson").setVisible(false);
Xrm.Page.getControl("new_bankname").setVisible(true);
Xrm.Page.getControl("new_checknumber").setVisible(false);
Xrm.Page.getControl("new_demanddraftnumber").setVisible(true);
Xrm.Page.getControl("new_bankaccountnumber").setVisible(false);
}
if(detailamt==100000003)
{
Xrm.Page.getControl("new_receivedperson").setVisible(false);
Xrm.Page.getControl("new_bankname").setVisible(true);
Xrm.Page.getControl("new_checknumber").setVisible(false);
Xrm.Page.getControl("new_demanddraftnumber").setVisible(false);
Xrm.Page.getControl("new_bankaccountnumber").setVisible(true);
}
}
hide the space (gap)
document.getElementById("new_checknumber_c").style.display = 'none';
document.getElementById("new_checknumber_d").style.display = 'none';
Hide a section:
function trainingrequired()
{
var detailamt= Xrm.Page.getAttribute("new_training").getValue();
if(detailamt==0)
{
Xrm.Page.ui.tabs.get("General").sections.get("Trainingss").setVisible(false);
}
if(detailamt==1)
{
Xrm.Page.ui.tabs.get("General").sections.get("Trainingss").setVisible(true);
}
}
Bit field
function documentforofferletter()
{
var detailamt= Xrm.Page.getAttribute("new_documentstouniversity").getValue();
if(detailamt==0)
{
Xrm.Page.ui.tabs.get("General").sections.get("Offerletter").setVisible(false);
}
if(detailamt==1)
{
Xrm.Page.ui.tabs.get("General").sections.get("Offerletter").setVisible(true);
}
}
Check Box:
function banksanction()
{
var myAttribute = "new_banksanctionletter";
var myControl = Xrm.Page.ui.controls.get(myAttribute);
var detailamt= myControl.getAttribute().getValue();
if(detailamt==true)
{
Xrm.Page.getControl("new_bank").setDisabled(false);
}
else
{
Xrm.Page.getControl("new_bank").setDisabled(true);
}
}
setting password:
function password()
{
var detailamt= Xrm.Page.data.entity.attributes.get("new_password").getValue();
var details= Xrm.Page.data.entity.attributes.get("new_typepassword").getValue();
if(detailamt == details)
{
Xrm.Page.ui.tabs.get("general").sections.get("generals").setVisible(true);
var pass = Xrm.Page.data.entity.attributes.get("new_typepassword");
pass.setValue(null);
Xrm.Page.ui.tabs.get("general").sections.get("password").setVisible(false);
}
else
{
alert("Wrong Password");
Xrm.Page.ui.tabs.get("general").sections.get("generals").setVisible(false);
}
}
function passwordonload()
{
Xrm.Page.ui.tabs.get("general").sections.get("generals").setVisible(false);
}