In Focus
C# Corner Mumbai Chapter: Learn Windows Presentation Foundation (WPF) with CMUG
Jabalpur Chapter Meet July 13: Register Now
Chandigarh Chapter: Developers Day on 29 June 2013
Delhi Chapter Hands On June 22: Limited Seats Register Now
Email :
Password :
Remember me?
Forgot password
Contribute
An Article
A Blog
A News
A Video
A Link
An Interview Question
Ask a Question
TECHNOLOGIES
.NET 4.5
Chapters
JavaScript, CSS
SharePoint 2010
Web Development
.NET Assemblies
Coding Best Practices
JQuery
SharePoint 2013
Web Services in C#
ADO.NET in C#
Current Affairs
JSP
Silverlight with C#
Windows 8
AJAX in C#
Databases & DBA
Leadership
Smart Devices
Windows Azure
Android Programming
Design & Architecture
Learn .NET
SQL
Windows Controls C#
Articles C#
Exception Handling C#
LightSwitch 2012
SQL Server 2012
Windows Forms C#
ASP.NET Controls in C#
Expression Studio
LINQ
Testing
Windows Phone 8
ASP.NET MVC with C#
Graphics Design
Mobile & Embedded
TypeScript
Windows Server 2012
ASP.NET Programming
How do I
Office 2013
Visual C#
Windows Store Apps
BizTalk Server
HTML 5
OOP/OOD
Visual Studio .NET
Workflow Foundation in C#
C# Language
Internet & Web
Operating Systems
Visual Studio 2010
WPF
C# Tutorials
iPhone/iPad
PHP
Visual Studio 2012
XAML
C, C++, MFC
Java
Products
WCF with C#
XML
Career Advice
Java and .NET
Project Management
Request a new Category
|
View All
ANSWERS
BLOGS
VIDEOS
INTERVIEWS
BOOKS
LINKS
NEWS
CHAPTERS
CAREER ADVICE
iOS 7 beta: Testers warned when using uncert ...
Design Simple Logo with help of Expression D ...
Credit Card Payment in ASP.Net using Stripe.com
Menu Style like jQuery
Why Constructor can't be declared Virtually? ...
Send Email in HTML Format using SQL database ...
Waiting Message in Window Application using C#
Merging Several Rows into a Single Row in SQ ...
Why Developers Should Read News
Get Values from Client Side to Server Side u ...
Blog
122
866
ASP.NET - Password Strength Indicator using jQuery and XML - Update 4
Posted by
Bryian Tan
in
Blogs
|
JQuery
on
Jul 24, 2012
ASP.NET - Password Strength Indicator using jQuery and XML (v01.03.00)
Tweet
1290
0
0
Couple weeks ago a CodeProject member reported that the "
Password Strength Indicator using jQuery and XML plug-in
" is displaying duplicate indicators. Yesterday, I was trying to integrate the plug-in with the MVC 3 application and ran into the mentioned issue.
Figure 1
After spending some time digging into it, I noticed that there was a problem with the jQuery id selectors. I should use the Attribute Equals Selector [id="value"] instead of Attribute Ends with Selector [id$="value"]. The former selector selects elements that have the specified attribute with a value exactly equal to a certain value. The later selector selects elements that have the specified attribute with a value ending exactly with a given string. That explain why the bar indicator appears next to both the password and confirm password textboxes. I have updated the plug-in and here is the correct approach to use the plug-in.
Listing 1
<script type="text/javascript">
$(document).ready(function () {
var myPlugin = $("input[id='Password']").password_strength();
$("[id='submit']").click(function () {
return myPlugin.metReq(); //return true or false
});
$("[id='passwordPolicy']").click(function (event) {
var width = 350, height = 300, left = (screen.width / 2) - (width / 2),
top = (screen.height / 2) - (height / 2);
window.open("PasswordPolicy.xml", 'Password_poplicy',
'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
event.preventDefault();
return false;
});
});
</script>
This Feature is Sponsored By
Make Your Data Do More with the Ignite UI Grid. Launch eye-popping, performance-driven HTML5 apps w/ Ignite UI's free jQuery Grid.
Similiar JQuery Selector and Tra..
JQuery script to get nice style on a button
comments
View Previous Comments
of
COMMENT USING
PREMIUM SPONSORS
Infragistics
Infragistics is experts in technology and design, and passionate about helping you build highly performant and stylish applications that solve problems, deliver inspiration, and maximize results.
More Blogs from this Blogger
sp_send_dbmail profile name is not valid
ASP.NET - Password Strength Indicator using jQuery and XML - Update 4
Here are your questions for the interviewer
SharePoint 2010 Missing Generate File Plan Report Link
Object reference not set to an instance of an object in SharePoint 2010
ReportViewer - ASP.NET session has expired
The requested site is either unavailable or cannot be found
SharePoint Server 2010 and Virtual Machine
See Object Explorer Details for objects in this folder
Regular Expression to validate file path and extension
View All
SPONSORED BY
Get the industry leading .NET Diagramming component
.NET Diagramming framework designed for creating advanced solutions
Follow @twitterapi
Latest Blogs
Encapsulate Field and Extract Interface in .NET
No HTTP resource was found that matches the request URI in MVC 4 Web API
Check Database Connection in MySQL using C#
Why Developers Should Read News
In Defence of Books
Media Player, Real Player, QuickTime Player in ASP.Net
Credit Card Payment in ASP.Net using Stripe.com
Crop Image in ASP.Net using Script
Creating Social Site Buttons By addthis.com in ASP.Net
Internals of C# Events
View All
Poll
Result
All Polls
Speed of C# Corner
How do you find speed of C# Corner when visiting the site?
Very Fast
OK
Slow
Very Slow
How do you find speed of C# Corner when visiting the site?
Options
Votes
%
Very Fast
5
8.33
OK
47
78.33
Slow
5
8.33
Very Slow
3
5.00
Total
60
100%