Solved

MVC 4 Custom Validation

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

17 Experts available now in Live!

Get 1:1 Help Now