I’m still pretty new to jQuery! Testing it out on my old website to test out it’s function. I can’t even get a simple jQuery script to run and it’s terribly embarrasing. Please help guys!
For some reason, I can’t get the jQuery selector to find element by id. Here’s the code
$(document).ready(function () {
if (jQuery) {
alert("jQuery working");
} else {
alert("jQuery not working");
}
$('#TextBox4').keyup(function () {
alert("KEYUP FUNCTION WORKENGGG");
var password = jQuery('#TextBox3').val();
var cfmPassword = jQuery('#TextBox4').val();
check_password_match(password, cfmPassword);
});
});
And this is my ASP html code.
<asp:TextBox ID="TextBox4" runat="server" BackColor="#181818" ForeColor="White"
TextMode="Password" ToolTip="Password">Password</asp:TextBox>`
<asp:TextBox ID="TextBox3" runat="server" BackColor="#181818" ForeColor="White"
TextMode="Password" ToolTip="Password" Height="22px">Password</asp:TextBox>`
Try this:
$('#<%=TextBox4.ClientID %>')On client side asp.net controls have id different than what you give it in aspx page.