Posted by : XRM Consultant Tuesday 20 October 2009

Hi,

In the below example, i had a list of 5 values stored in a field as a picklist. When values 1 and 2 were chosen i wanted to hide the field, and display it when values 3,4 and 5 are selected. If you only have a single value to hide the field, then simple remove the "if else" part of the code below...


if(crmForm.all.cit_phonestatus.DataValue == 1)
{
    crmForm.all.cit_dateret.disabled = true; // to disable

    // to hide
    crmForm.all.cit_dateret.style.display = "none";
    crmForm.all.cit_dateret_c.style.display = "none"; // for label
}
else if(crmForm.all.cit_phonestatus.DataValue == 2)
{
    crmForm.all.cit_dateret.disabled = true; // to disable

    // to hide
    crmForm.all.cit_dateret.style.display = "none";
    crmForm.all.cit_dateret_c.style.display = "none"; // for label
}

else {

crmForm.all.cit_dateret.disabled = false;
    crmForm.all.cit_dateret.style.display = "";
    crmForm.all.cit_dateret_c.style.display = "";
}

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Search This Blog

Popular Post

About xRM Consultant.com

Having worked with Microsoft Dynamics CRM 4.0 in a sales & development environment, my focus now is on customising this awesome solution and showing its true potential.
Powered by Blogger.

- Copyright © xRM Consultant -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -