web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Adding border to text field

(0) ShareShare
ReportReport
Posted on by

Hi, I am fairly new to CRM and have been making changes as i use the system. I have been asked to add borders to all the text fields on the form rather than just when hovering over the text field. Please advise. Also as an added note i have tried to add javascript that loads CSS however I'm not having much luck with that.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    There is no supported way of doing it, and it is not recommended to do any changes in DOM, I will suggest you to use html web resource for these kind of requirement under your form, where you have much flexibility to do these type of things.

    Thanks

  • Community Member Profile Picture
    on at

    Hi i am unsure as to what the HTML would be for sorting this out. Also when i try to add a web resource such as a CSS file to a form it just errors saying "invalid type for a form"

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    You can't use CSS web resources for entity form, instead they are used for formatting your html web resource.

    By html web resource to create your fields there for example let's say you need to show three text boxes with border, assuming you already have three text field in entity form, so create one html web resource and create three html text fields there where you can apply formatting through css or javascript. and then once user will enter value there pass that value to your source field (which is available in entity) so your value will be stored in entity field and similarly when form is opened read those values and display it under your text box.

    You can refer this example : nishantrana.me/.../using-html-web-resource-in-crm-2011

    Thanks

  • Verified answer
    Pranesh M Juwale Profile Picture
    1,196 on at

    There is no supported way.

    You can try jscript customisations for styling textfields as:

    function SetTextFieldBorder() {

       var attrs = Xrm.Page.data.entity.attributes.get();

       for (var i = 0; i < attrs.length; i++) {

           var id = attrs[i].getName();

           $('#' + id).find('.ms-crm-Inline-Value').css('border', 'solid 1px red');

       }

    }

    attach this on form onload of the entity.

  • hostis_72 Profile Picture
    10 on at

    when I have added this I get an error:

    ReferenceError: '$' is undefined

    can you advise please?

  • Community Member Profile Picture
    on at

    '$' is undefined error may be due to missing JQuery webresource. You need to add on the form resources. After adding re-order web resources on form so that newly added JQuery is on top.

  • R_Ashish Profile Picture
    40 on at

    I have applied this jscript  in Version 9 of dynamics crm but still it's not showing boarders to text boxes in the page

    I am getting schema name values of id in   var id = attrs[i].getName(); but still not showing boarder to text box

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans