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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

How to make field Required is option set value is true in power apps portal

(0) ShareShare
ReportReport
Posted on by 365
I have Tested the following code but its not working
$(document).ready(function(){
    
            $("#tfs_businessfiledforbankruptcy").change(RequiredPBC);
         });
         function RequiredPBC(){
             debugger;
             var Checked =  $("input[id='tfs_businessfiledforbankruptcy_1']:checked").val();
             if(Checked==1)
             { 
                 $("#tfs_typeofbusinessbankruptcy").attr('required'true);
                 $("#tfs_typeofbusinessbankruptcy").closest("td").find("div.info").addClass("required");
                 
             }
             else{
                $("#tfs_typeofbusinessbankruptcy").attr('required'false);
                $("#tfs_typeofbusinessbankruptcy").closest("td").find("div.info").removeClass("required");
    
             }

         }
pastedimage1622702882624v1.png
I have the same question (0)
  • AkshayShah Profile Picture
    70 on at

    Hello Sir,

    As you write code

    $(document).ready(function(){

               $("#tfs_businessfiledforbankruptcy").change(RequiredPBC);

            });

            function RequiredPBC(){

                debugger;

                var Checked =  $("input[id='tfs_businessfiledforbankruptcy_1']:checked").val();

                if(Checked==1)

                {

                    $("#tfs_typeofbusinessbankruptcy").attr('required', true);

                    $("#tfs_typeofbusinessbankruptcy").closest("td").find("div.info").addClass("required");

    //add this code

    return false;

                }

                else{

                   $("#tfs_typeofbusinessbankruptcy").attr('required', false);

                   $("#tfs_typeofbusinessbankruptcy").closest("td").find("div.info").removeClass("required");

                  return true;

                }

            }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 144 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 59

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans