Insert Label without textbox on crm 2011 form

Answered Insert Label without textbox on crm 2011 form

  • Tuesday, May 31, 2011 9:02 AM
     
     

    Dear all,

    I need a way to insert only a label without its textbox to a crm 2011 form ?? how can I do such thing,because crm does not allow to insert only a label ??

     


    Thank you.

All Replies

  • Tuesday, May 31, 2011 2:47 PM
     
     Proposed Answer

    Hello Sam,

     

    You can either use the following code for an existing field: document.getElementById("<field_schema_name>_d").style.display = "none" or, a more elegant way, by inserting a DOM element via JavaScript, in runtime. Click here for a complex example, about how to generate a custom button on the form, for CRM 2011 & CRM 4.0. Same principles apply to a simple label as well, it's a matter of formatting the element.


    Cornel Croitoriu - Senior Software Developer & Entrepreneur

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

  • Wednesday, June 01, 2011 7:14 PM
     
     Answered
    Found this post from Mitch Milam: Adding form labels using HTML web resources

    http://blogs.infinite-x.net/2011/05/20/adding-form-labels-using-html-web-resources/


  • Monday, January 02, 2012 9:46 PM
     
     

    Look at this, maybe this can help

    if you already found another solution please share it with us

    http://blogs.infinite-x.net/2011/05/20/adding-form-labels-using-html-web-resources/

  • Sunday, January 08, 2012 12:18 PM
     
     

    Hello Sam,

     

    You can either use the following code for an existing field: document.getElementById("<field_schema_name>_d").style.display = "none" or, a more elegant way, by inserting a DOM element via JavaScript, in runtime. Click here for a complex example, about how to generate a custom button on the form, for CRM 2011 & CRM 4.0. Same principles apply to a simple label as well, it's a matter of formatting the element.


    Cornel Croitoriu - Senior Software Developer & Entrepreneur

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

    Hello Cornel,

    i am curious about this  document.getElementById("<field_schema_name>_d").style.display = "none" please can you tell why you nedd to add a "_d" to get Element Id?

    Thanks


    Be wise
  • Thursday, February 02, 2012 3:05 PM
     
     

    I found this old method works as well in 2011 , but not sure how long it will be supported;

    crmForm.all.new_contractors_d.style.display="none";

    the _d refers to the input area. _c would refer to the label. not sure who picked these letters.

     

    Cheers

    Glen

  • Monday, February 13, 2012 3:16 PM
    Moderator
     
     

    The crmForm items are deprecated technically and should only be used for 4.0 backward compatibility.  getElementbyId in jscript is also not supported.  The web resource method using html to insert a label control is really correct here.


    Jamie Miley
    Check out my about.me profile!
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!