Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Make a field hidden by default on portal entity form

Posted on by 270

Hello,

How Can Make A field hidden by default on entity form, when load the page on Portal. I want this field to be visible after an event Occurs.

My field is hidden due to this javascript code:

    $document ).ready(function() {
            $("#field").closest("tr").hide();
    });
But, the field is displayed for a quick instant then hidden.
I want it to be hidden by default.
  • Suggested answer
    Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 User Group Leader on at
    RE: Make a field hidden by default on portal entity form

    Hello Don,

    No, You will not need access to the Entity form's HTML.

    Have you tried to achieve this using CSS only :

    #field tr:nth-child(rownumber) {display:none}

    Alternatively, you can achieve it by adding the class dynamically:

    1. Define a class in CSS

    .hideDiv

    {

     display: none

    }

    2. Now, add this class to your element dynamically:

      $( document ).ready(function() {

             $("#field").closest("tr").addClass("hideDiv")

       });

  • Don foufione Profile Picture
    Don foufione 270 on at
    RE: Make a field hidden by default on portal entity form

    Hello,

    Yah, it's interesting but if only I got access to the entity Form HTML. they propose to add a class to the element. I don't think it is possible int the portal, isn't it?

    div.hidden

    {

      display: none

    }

    <div id="extraControls" class="hidden">

    </div>

    $(document).ready(function() {

       $("div#extraControls").removeClass("hidden");

    });

  • Suggested answer
    Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 User Group Leader on at
    RE: Make a field hidden by default on portal entity form

    Hello Don,

    You can refer to this link for solution:  stackoverflow.com/.../how-do-i-hide-an-html-element-before-the-page-loads-using-jquery

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans