Saturday, August 28, 2010

Hiding a memo field on a CRM form

So I was working away the other day and got a request to hide a memo field on a CRM form.  This is a little bit more complex than just setting the display or visible style attribute.  Here's how it's done:


/*hide memo field*/
document.getElementById("neu_viewstartext_c").style.display = "none";
document.getElementById("neu_viewstartext_d").style.display = "none";
var parentTr =document.getElementById("neu_viewstartext").parentNode.parentNode;
var tr = parentTr.nextSibling;
for(var x = 0; x<3; x++) {/*hide*/
    tr.height = "1";
    tr= tr.nextSibling;/*Assign to sibling*/
}
for(var x = 0; x<3; x++) {/*show*/
    tr.height = "25";
    tr= tr.nextSibling;/*Assign to sibling*/
}

No comments:

Post a Comment