I have a .Net page with some textboxes, which are sometimes disabled.
<asp:TextBox ID="TextBox1" runat="server" CssClass="tb"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" CssClass="tb" Enabled="false"></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server" CssClass="tb"></asp:TextBox>
With jQuery, I want to do the following:
If a textbox loses the focus, I want to select the next enabled textbox if there are any.
Otherwise, I want to do something else (e.g. display a message).
I don´t know how to do that.
jQuery(document).ready(function () {
$('.tb').blur(function() {
});
});
Generated html:
<input name="ctl00$MainContent$TextBox1" class="tb" id="MainContent_TextBox1"
type="text"/>
<input name="ctl00$MainContent$TextBox2" disabled="disabled" class="aspNetDisabled tb"
id="MainContent_TextBox2" type="text"/>
<input name="ctl00$MainContent$TextBox3" class="tb" id="MainContent_TextBox3"
type="text"/>
http://jsbin.com/ixevor/edit#javascript,html