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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Show/Hide Form Section...
Power Pages
Unanswered

Show/Hide Form Sections in Power Pages

(0) ShareShare
ReportReport
Posted on by 6

How do you properly show/hide form sections in Power Pages?

 

I tried using a business rule and that didn't work.

 

I tried using Javascript based on a yes/no field called remote. Here is my form:

 

Screen Shot 2022-09-09 at 11.25.17 AM.png

 

Here is my Javascript:

 

$(document).ready(function () {
 $("#cr92a_remote").change(function () { FieldChanged(); });
});

FieldChanged = function(){
 var selectedValue = $("#cr92a_remote").find("input[type='radio']:checked").val();
 if(selectedValue == true){
 $("table[data-name='sec_shipping']").parent().show(); /// and .hide();
 }
 else{
 $("table[data-name='sec_shipping']").parent().hide(); /// and .hide();
 }
};

 

 

My section name is sec_shipping on the form designer.

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @jordanbbardwell 

    You can use vanilla JS / Jquery to hide your sections. In addition to "document. ready", try adding the trigger for the form by finding the form id. Adding sample below.  

     

     

    $(document).ready(function () {
     $("#EntityFormControl_enityformcontrolid").on("loaded", function () {
     // your logic
     });
    });
    

     

    Please give it a try and let us know. 

     

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

  • jordanbbardwell Profile Picture
    6 on at

    I'm not sure I follow. What does finding the form ID have to do with the section?

  • jordanbbardwell Profile Picture
    6 on at

    I'm not sure I follow. What does finding the form ID have to do with the section?

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @jordanbbardwell 

     

    Sections are part of the form. You have to get the form id and then the child section id to trigger your jquery properly. 

     


    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

     

     

     

  • Community Power Platform Member Profile Picture
    on at

    $("table[data-name='<section name>']").parent().hide(); // show();

  • shakirullah12 Profile Picture
    10 on at

    Hi @ragavanrajan, If we want to hide the complete form with out any condition, Actually  i want to hide out of the box form and add a custom HTML and than stored the data from the HTML form to the actual form?

    If you could help me i will be very thankful.  

  • GWham1 Profile Picture
    on at

     

    /***********************************
    ** HIDE FIELDSET BY NAME
    ***********************************/
    
    // via js
    $("body").find("fieldset[aria-label='General']").hide();
    
    // via css
    fieldset[aria-label="Hidden"]{ display:none; }
    
    /***********************************
    ** HIDE SECTION BY NAME
    ***********************************/
    
    // via js
    $("body").find(".section[data-name='General']").hide();
    
    // via css
    .section[data-name="General"]{ display:none; }
    
    /***********************************
    ** HIDE ROW BY FIELD-ID
    ***********************************/
    
    // via js
    $("#fieldid").closest("tr").hide();

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard