how to call asp.net's TextBox control's onFocus() method in JQuery?
Hi,
I want to create a registration form in which when user clicks on a textbox feild, then a helper text appears. Like the one already created on the following page-
https://accounts.zoho.com/register?servicename=ZohoDiscussions&serviceurl=http://forum.jquery.com
Below is my not working code, can any one figure out what I'm doing wrong in this?
- <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js">
$(function(){
$("TextBox")
.focus(function () {
$(this).next("span").fadeIn(1000);
})
.blur(function () {
$(this).next("span").fadeOut(1000);
});
)};
</script>
- <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" FinishDestinationPageUrl="~/NewUser.aspx" CreateUserButtonText="Add"
oncreateduser="CreateUserWizard1_CreatedUser1"
onfinishbuttonclick="CreateUserWizard1_FinishButtonClick">
- <WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" >
<ContentTemplate>
<div class="registration-form">
<ol>
<li>
<asp:Label ID="UserNameLabel"
- runat="server" AssociatedControlID="UserName"
- SkinID="label">Username
- </asp:Label>
<asp:TextBox ID="UserName" runat="server"
- SkinID="textBox" TabIndex="1">
- </asp:TextBox>
<span>Enter username.</span>
</li>
<li>
<asp:Label ID="PasswordLabel"
- runat="server" AssociatedControlID="Password" SkinID="label">
- Password</asp:Label>
<asp:TextBox ID="Password"
- runat="server" TextMode="Password"
- SkinID="textBox" TabIndex="2"></asp:TextBox>
<span>Enter password</span>
- </li>
<li>
<asp:Label ID="ConfirmPasswordLabel" runat="server"
AssociatedControlID="ConfirmPassword" SkinID="label">
- Confirm Password</asp:Label>
<asp:TextBox ID="ConfirmPassword"
- runat="server" TextMode="Password"
- SkinID="textBox" TabIndex="3"></asp:TextBox>
<span>Re-enter password</span>
</li>
- </ol>
</div>
</ContentTemplate>
</asp:CreateUserWizardStep>
- </asp:WizardStep>
- </asp:CreateUserWizard>
Actually I want to display helper text on textbox's (of both wizard one and two) OnFocus method. And I want it generic because I have too many text boxes so I can't call each of them by writing its ID, If I do this it will make my code to way long, so lengthy like repeating same code too many times.
I want a generic cross-browser solution.
Please help I'm new to JQuery!
Regards,
newbiee