cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alfredokijr
Frequent Visitor

Enable or disable SUBMIT based on a field value

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).

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
alfredokijr
Frequent Visitor

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.

 

View solution in original post

2 REPLIES 2
alfredokijr
Frequent Visitor

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.

 

View solution in original post

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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Users online (17,307)