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

JQuery to match 2 number fields

(0) ShareShare
ReportReport
Posted on by

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,365 Super User 2025 Season 2 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

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 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard