Solved

MVC 4 Custom Validation

Posted on 2013-06-23
1
398 Views
Last Modified: 2013-06-24
Like most websites that allow a user to create an account will also have them type and re-type the password. I am looking to do this with a Custom Validator. Does anyone have an example?
0
Comment
Question by:AmbassadorSpock
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 500 total points
ID: 39272298
Hi,

Check this jQuery validation code -

    $('#btnChange').bind("click", function (event) {
        var txtNewPassword = $('#txtNewPassword').val();
        var txtConfirmNewPassword = $('#txtConfirmNewPassword').val();

        if (txtNewPassword.length <= 0 ||
            txtConfirmNewPassword.length <= 0) {
            event.preventDefault();
        }

        if (txtNewPassword != txtConfirmNewPassword) {
            event.preventDefault();
        }
    });

Open in new window


Hope it helps u...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question