locked
How to hide a Section which only contains an iframe RRS feed

  • Question

  • I normally use this code to hide a section:

    crmForm.all.new_prxgroupid_d.parentNode.parentNode.parentNode.style.display =

    "none";

    However I do not have a field in the section I want to hide.

    Any ideas?


    Withers
    Tuesday, December 29, 2009 5:07 PM

Answers

All replies

  • Hi,


    Try to use the IFRAME's label to hide the section.

    crmForm.all.new_IFRAMENAME_c.parentNode.parentNode.parentNode.style.display = "none";

    Haven't tried this myself but I think this should work.


    Hassan.


    Hassan Hussain | http://hassanhussain.wordpress.com/ | http://www.mscrmvirtualusergroup.com/
    • Proposed as answer by Hassan Hussain Tuesday, December 29, 2009 5:15 PM
    • Marked as answer by David Withers Tuesday, December 29, 2009 5:38 PM
    Tuesday, December 29, 2009 5:14 PM
  • Take the following code, and execute it with the name of your Iframe as its parameter:

    function ConcealSectionByField(fieldName) {
      var fieldContainerTD = document.getElementById(fieldName + "_d");
      var fieldContainerTR = fieldContainerTD.parentNode;
      var fieldContainerTB = fieldContainerTR.parentNode;
      var fieldContainer = fieldContainerTB.parentNode.parentNode.parentNode;
    
      fieldContainer.style.display = "none";
    }
    Example:

    ConcealSectionByField("IFRAME_MyIframe");
    And to reverse it:

    function RevealSectionByField(fieldName) {
      var fieldContainerTD = document.getElementById(fieldName + "_d");
      var fieldContainerTR = fieldContainerTD.parentNode;
      var fieldContainerTB = fieldContainerTR.parentNode;
      var fieldContainer = fieldContainerTB.parentNode.parentNode.parentNode;
    
      fieldContainer.style.display = "block";
    }

    Dave Berry
    Tuesday, December 29, 2009 5:16 PM
    Moderator