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 / Enable or disable SUBM...
Power Pages
Answered

Enable or disable SUBMIT based on a field value

(0) ShareShare
ReportReport
Posted on by 33

Hello!

 

I want to disable the native SUBMIT button on a web form until the user selects YES to the field labeled Confirm Submission?.

 

alfredokijr_0-1615927322945.png

 

I've added the following code into the Form Options tab of the web form step but it doesn't appear to be working:

 

$(document).ready(function(){
    let currentVal = $("wsi_confirmsubmission1 option:selected").val();
    //do some validation
    if(currentVal == "866490001") {
        $("#NextButton").prop( "disabled", true);
    } else {
        $("#NextButton").prop( "disabled", false);
    }
 
    $("#wsi_confirmsubmission1").change(function () {
// Get value of your trigger field
let currentVal = $("#wsi_confirmsubmission1 option:selected").val();
//do some validation
if(currentVal == "866490001") {
$("#NextButton").prop( "disabled", true);
} else {
$("#NextButton").prop( "disabled", false);
}
});
});

 

Help will be much appreciated! (Note: I'm not a developer and know little about javascript/jquery).

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Alfredo Ki Jr Profile Picture
    33 on at

    This script works:

    alfredokijr_2-1615965649549.png

     

    I just had to modify the jquery selector from :selected to :checked as the Confirm Submission? field is a radio button control and not a drop-down.

     

  • alrezac Profile Picture
    on at

    Hi,

     

    Thanks for your follow up post! I am glad that you were able to figure out what your issue was. Hopefully this will prove useful for future communities users.

     

    Regards,

     

    Alex

     

    -------

     

    Community Support Team _ Alex Rezac
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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
Fubar Profile Picture

Fubar 70 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard