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 Apps / Power pages javascript...
Power Apps
Answered

Power pages javascript in a form

(1) ShareShare
ReportReport
Posted on by 112
Hello everyone, I am currently trying to make something where when you hit the submit button on a form it will have a pop up message saying "hello". My ultimate goal is to make this form update multiple tables but as of now this is what I have. 
 
if (window.jQuery) {
    (function ($) {

        $("#InsertButton").on('click', function () {

            alert("Hello");

            $("#statuscode").val(717640002);

            return true;
        });
    }(window.jQuery));
}
 
Each time I submit the form it doesn't work. I have no idea what I'm doing wrong. Does anyone have any idea what I might be doing wrong?
I have the same question (0)
  • Verified answer
    ZackS Profile Picture
    112 on at
    Sup guys, I figured it out. 
     
    $(document).ready(function () {
     
        const submitButton = document.querySelector('#InsertButton');

        if (submitButton) {
            submitButton.addEventListener('click', function(event) {

                alert("Submit button clicked! Form is being submitted...");

            });
        }
    });
     

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard