9. April 2012 15:36
ASP.NET - Password Strength Indicator using jQuery and XML – Update 3 (v01.03.00)
Recently a user reported to me the issue with the Password Strength Indicator using jQuery and XML plug-in. The problem will occur (Figure 1) if the Label control ID contains the ID of the Textbox control (Listing 1).
<asp:label runat="server" id="lblPassword" AssociatedControlId="Password">Enter Password:</asp:label>
<asp:TextBox ID="Password" runat="server"></asp:TextBox>
This issue is very rare but they are several solution we can apply to suppress it.
- Exclude the id attribute from the Label control
- Make sure that the Label control ID does not contain the ID of the Textbox/input control
- Modify this line
var myPlugin = $("[id$='txtPassword']").password_strength();
var myPlugin = $("input[id$='txtPassword']").password_strength();