Hide Data and Keep Caption of a field

Hi,

am in sage CRM version i7

i have a problem here, i added some création code like this :

Caption = '<hr size="2" width="500%" noshade color=grey><b><font color=blue>Bank Account Information :</b><br><hr size="2" width="500%" noshade color=grey></tr><tr>';

it will replace my caption with an Hr and some text , but the problem that the field has been displayed in the top without caption,

but i want to hide the data field and keep the caption , because i wanna divide my screen (summary screen) by using this method

here a capture of what i have

and thats the result

thanks for help,

  • 0

    Something like this in the custom content of the screen perhaps?

    if (window.addEventListener)

    {

    //firefox way of binding an event

    window.addEventListener("load", page_code, false)

    }

    else

    if (window.attachEvent)

    {

    //IE exclusive method for binding an event

    window.attachEvent("onload", page_code)

    }

    function page_code() {

    document.getElementById('_Datacomp_my_field').style.visibility="hidden";

    }

    Obviously you'll need to check inspect the page to find the correct DOM reference for _Datacomp_my_field.

  • 0

    Thanks too much Brad for your help

    i have tried with custom content and i have my result but i have either some
    tags on the top

  • 0

    Hello, any solution found  for this?

  • 0 in reply to Jerome deH.

    I can't see the images of the original post, but if you want to add a divider line to a screen I do the following

    Create a 1 character text field (e.g. xxxx_Blank01)

    Add the field to the screen on a new line and 5 columns wide

    In the CreateScript put in the following and edit the bit towards the end to be the caption you want

    var strText = "";
    strText += "<BR><TABLE BGCOLOR='#6795C3' WIDTH=100%><TR><TD></TD></TR></TABLE>";
    strText += "<font style='color:#003D72;text-decoration:none;font-family: Verdana; font-size: 13px; font-weight:bold;'>";
    strText += "Bank Details</font>";
    Caption = strText;
    ReadOnly=true
  • 0 in reply to Matthew Shaw

    Hi Matthew,

    Thanks for this. The divider is added but the field is still present. I use the French version of Sage CRM and the CSS has been slightly adapted. The readonly fields are displayed with a grey background in edit mode. This is the reason why want to keep the caption but remove the value ( even when empty). this could also remove the unnecessary space under the caption.

      

  • 0 in reply to Jerome deH.

    Sorry I don't know how to hide the data bit of a field but keep the caption on screen, I'm using the default CSS so empty / read only fields are the same as the background for me. 

  • 0 in reply to Jerome deH.

    You should be able to use some client side code to change the field value in 'View' mode.
    For example

    //This allows you to grab the field
    var myfield = crm("comp_name");
    //This allows you to see if the field is in 'View' mode
    myfield.getMode();
    //This allows you to change the value in the display to what ever you need
    myfield.text("hello world");