locked
How to hide lookup fileds on the form using javascript when form is loaded RRS feed

  • Question

  • Hi all,

        I need to know,How to hide lookup fileds on the form using javascript when form is loaded.
    crmForm.all.field1.style.visibility='hidden';----Its not working
    Please reply with proper solution.


    Thanks
    Natarajan
    Natarajan.V
    Monday, June 22, 2009 6:21 AM

Answers

  • hi,

    try this

    crmForm.all.attributename_c.style.visibility = 'hidden'; //label
    crmForm.all.attributename_d.style.visibility = 'hidden'; //data
    regards,
    kishan
    Monday, June 22, 2009 12:38 PM
  • Hi
        Use display instead of visibility. Try this code:

    crmForm.all.field1_c.style.display='none';
    crmForm.all.field1_d.style.display='none';

    everything is a matter of probability...
    Monday, June 22, 2009 12:58 PM

All replies

  • Hi, Natarajan.

    Try following code:

    crmForm.all.field1_c.style.visibility='none';
    crmForm.all.field1_d.style.visibility='none';
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Monday, June 22, 2009 6:29 AM
    Moderator
  • Hi Natarajan,

    Try this :

    document.HideElement = function(elementId) {
        if (document.getElementById(elementId))
            document.getElementById(elementId).style.display = 'none';
    }

    document.HideElement("field1_c");
    document.HideElement("field1_d");


    Regards,
    Chinmay
    http://metrix.blogspot.com
    • Proposed as answer by Chinmay Patel Monday, June 22, 2009 6:48 AM
    Monday, June 22, 2009 6:48 AM
  • Hi Andriy,

     The above said method not working for hide lookup,is there anyother method to hide lookup.


    Thanks
    Natarajan
    Natarajan.V
    Monday, June 22, 2009 12:32 PM
  • hi,

    try this

    crmForm.all.attributename_c.style.visibility = 'hidden'; //label
    crmForm.all.attributename_d.style.visibility = 'hidden'; //data
    regards,
    kishan
    Monday, June 22, 2009 12:38 PM
  • Hi
        Use display instead of visibility. Try this code:

    crmForm.all.field1_c.style.display='none';
    crmForm.all.field1_d.style.display='none';

    everything is a matter of probability...
    Monday, June 22, 2009 12:58 PM