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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to get a handle on...
Power Pages
Answered

How to get a handle on a portal generated button

(0) ShareShare
ReportReport
Posted on by 15

How do you get a handle on a button that is created from the Advanced Form Metadata in Portal Management?  I want to create a jQuery onClick event and I'm not able to fire the event using the button id I capture when I inspect the button from Chrome Developer Tools.

 

portal.png

 

Here is the button and  jQuery:

portal1.pngportal2.png

Categories:
I have the same question (0)
  • H V Profile Picture
    1,510 on at

    Hi @z_mike70 

     

    May I know, what you want to achieve using button onClick event??

     

    Like validate some field value or change the text or something else.

  • z_mike70 Profile Picture
    15 on at

    I want to launch a modal window where you can upload attachments.

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

    HI @z_mike70 

    You need to call the Onclick event slightly different.  I am adding an example below.  Inspect your button either you get the id of the button or use the CSS class name. 

     

    ragavanrajan_0-1633923025555.png

     

     

     

    Try the following code.  Using the id of the button as an example 

     

     

    $(document).ready(function() {
     $('#NextButton').on("click", function() {
     console.log(555, "Ragavan");
     alert("Modal Test")
     });
    
    
    });

     

     

     Output: 

     

    ragavanrajan_2-1633923225411.png

     

     


    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.

  • z_mike70 Profile Picture
    15 on at

    Thanks.  Instead of getting a handle on the button using ID, I used class.  That seems to work.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 42

#2
Valantis Profile Picture

Valantis 24

#3
omkarsupreme Profile Picture

omkarsupreme 23

Last 30 days Overall leaderboard