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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 395

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 287 Super User 2026 Season 1

Last 30 days Overall leaderboard