Solved

MVC 4 Custom Validation

Posted on 2013-06-23
1
392 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
error on the asp.net page 1 33
Remove greater than sign 3 42
how to read json value 2 27
Error on link 14 36
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short film showing how OnPage and Connectwise integration works.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now