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 Pages / Make Form field on pag...
Power Pages
Unanswered

Make Form field on page required based on another fields value with javascript

(0) ShareShare
ReportReport
Posted on by 977

Hey All - brand new to java scripting in portal pages.

 

I'm trying to say if DOB Unknown is set to No, which is the default setting for this field, make Victims Date of Birth Required. If DOB unknown is set to Yes, don't make Victims Date of Birth required. I'm using this snippet of code I found online 

 

//New code DOB required
function makeDobRequired() {
    debugger;
    var KnowDob = $("#hd_victim_dob_unknown").val();
    if (KnowDob  == 0) //if dob is  known
    {
        makeRequired('cra83_dateofbirth');
           }
    else if (KnowDob  == 1) ////if dob is not known
    {
        makeNotRequired('cra83_dateofbirth');
    }
}
 
it's not working tho. Can anyone share the correct code to execute this? 
 
ctedesco3307_0-1695304201656.png

 

thx 
Categories:
I have the same question (0)
  • fm_skeller Profile Picture
    277 Moderator on at

    what is the definition of the 'makeNotRequired' and 'makeRequired' function?

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 35 Super User 2026 Season 1

#2
Mohsin Ali Profile Picture

Mohsin Ali 25

#3
11manish Profile Picture

11manish 20 Super User 2026 Season 2

Last 30 days Overall leaderboard