locked
Hiding a field based on the action of a Lookup field RRS feed

  • Question

  • I am familiar with hiding and revealing a field based upon a picklist selection, but would now like to take it further and hide and reveal a field based upon selections from a lookup. For example, if I have on my lookup the following options:  Carrots, Beef, Potatoes, Beans, Chicken, I would like to reveal another field for those records which are Beef and Chicken, but not those lookup records for the rest.  The lookup naturally has the added benefit of being easy to add new lookup records

    Any ideas would be most appreciated.
    Jim
    Wednesday, July 1, 2009 9:18 PM

Answers

  • Hi jimbo,

    You can do like this

    var lookupitem=new Array;
    lookupitem=crmForm.all.lookupfield.DataValue;
    var result=lookupitem[0].name;
    alert(result);
    if(result=="chicken")
    {
    //hide the field
    }


    Thanks, Aarch
    Thursday, July 2, 2009 5:03 AM