Solved

MVC 4 Custom Validation

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

Independent Software Vendors: 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

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…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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