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 / css for entity form th...
Power Pages
Unanswered

css for entity form that has a quickview control on

(0) ShareShare
ReportReport
Posted on by 13

Hi all

Seem to be having an issue that should be far simplier , but i think it is the way the dom is loading the form

I have an entity form and wish to have the "question number" and "questions in line with each other.  the 1.1 is coming from one table and the rest of the form from another table.  so a quickview control for 1.1 number.

 

I have as a test  id of #py3_sectionnumber being  1.1

 

$(window).load(function() {
$("#py3_sectionnumber").hide();
});

 

which on testing does nothing, so i think the form loads, then the quickview section after, hence why this basic jquery is not catching it.  if it doe the same for  $("#py3_question_name").hide();  that works.  

screen1.PNG

Also the question text is longer than the div , attempts to wrap the text are failing 

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

    Hi @srbonera 

     

    In Portal Management: 

     

    Under content

    1. Lists > Select your entity > options 

     

    under custom javascript 

     

    <script>
    $( document ).ready(function() {
     $('#terms-and-conditions-section').hide();
    });
    </script>
    

     

    Note: Make sure you write your JS in the list section and use (document).ready function. 

     


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

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

  • srbonera Profile Picture
    13 on at

    My Issue is with an entity form, not entity list,  i am aware that you use document ready or window load function to add additional code, As two of the fields are from a quickview control they are not loading till after the form has loaded.  

     

    I see this by doing a simple alert on the question field and my alert returns its value, i dismiss the alert and the question number value then loads, so clearly the loading of the data from the quickview is loading after the form has loaded so how do i capture that.

     

     found this which suggest to use the isloaded to check the quickview is loaded and then to get its value 

    isloaded formcontext.ui.quickforms   Does that code apply just to a model driven quickview form or a quickview form on a portal aswell

  • natalya Profile Picture
    133 on at

    Hi @srbonera,

    I think  you have to wait until your quickview form is loaded and after that apply your changes.

    you can use setTimeout(function () { your code}, waiting time);

    Please note client scripting  you use for model-driven apps does not work for Portal.
     
     

     

  • KissyWolf Profile Picture
    2 on at

    @srbonera wrote:

    My Issue is with an entity form, not entity list,  i am aware that you use document ready or window load function to add additional code, As two of the fields are from a quickview control they are not loading till after the form has loaded.  

     

    I see this by doing a simple alert on the question field and my alert returns its value, i dismiss the alert and the question number value then loads, so clearly the loading of the data from the quickview is loading after the form has loaded so how do i capture that.

     

     found this which suggest to use the isloaded to check the quickview is loaded and then to get its value 

    isloaded formcontext.ui.quickforms   Does that code apply just to a model driven quickview form or a quickview form on a portal aswell greatpeople


    This is really amazing. Great information about blog.

  • srbonera Profile Picture
    13 on at

    @NatGeo it would appear if i use a set timeout in the script, the quickview form is still loading after my script has run, so i can't catch the div i need.

  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    Hi @srbonera,

    Quick view form on the Portal is rendered as an iframe. So you need to work with it as you would work with an iframe (see w3school for more details -https://www.w3schools.com/howto/howto_js_element_iframe.asp).

    $( document ).ready(function() {
     //register event listener for load event of your iframe
     //you can find id of the iframe by inspecting page
     //or by changing the name of the quick view form control on the form
     $("#QuickviewControl1628694904800").on('load',
     function() {
     console.log("I am loaded!");
     //get this iframe to manipulate it content
     let thisIframe = document.getElementById("QuickviewControl1628694904800");
     //get necessary element and perform all operations that you need
     let email = thisIframe.contentWindow.document.getElementById("emailaddress1");
     console.log(email);
     }
     );
    })

     You will need to use javascript with this approach. 

  • srbonera Profile Picture
    13 on at

    image.PNG

    Thank you so much, very appreciated. One to note for the future for sure.  Thanks again

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