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 / JQuery to match 2 numb...
Power Pages
Unanswered

JQuery to match 2 number fields

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello smart folks,

my scenario is , customer open a page has 2 fields only:

1- Last 4 SSN

2- Renter Last 4 SSN

 

I want to:

1-make sure both entry matches, if not then show error message

2- hide submit button until validation successful (#1 is true)

 

 

can someone tell me why my codes doesnt work?

 

$(document).ready(function () {
 $("#UpdateButton").hide();
 $('#new_last4ssn').change(function () {
 var FirstSSN = $("new_last4ssn");
 var SecondSSN = $("new_reenterlast4ssn");
 if (SecondSSN == FirstSSN) {
 return true;
 document.getElementById('#UpdateButton').style.visibility = 'visible';
 }
 alert("Please enter matching numbers !");
 return false;
 $("#UpdateButton").hide();

 });
});

 

Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    You need to compare the values of the fields (at the moment you are comparing the 2 objects).

    eg.
     var FirstSSN = $("new_last4ssn").val();
    

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 61

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 40 Most Valuable Professional

#3
11manish Profile Picture

11manish 30

Last 30 days Overall leaderboard