我有以下代码,当用户在月份文本框中输入两个数字时,如何使光标自动跳转到下一个textfield (这里是dd )?
<p>
<h5>Date of Birth <font color="red">* </font>(mm/dd/yyyy)</h5>
<asp:TextBox ID="mm" runat="server" MaxLength="2"></asp:TextBox>
<asp:TextBox ID="dd" runat="server" MaxLength="2"></asp:TextBox>
<asp:TextBox ID="yyyy" runat="server" MaxLength="4"></asp:TextBox>
</p>发布于 2014-11-18 05:31:03
您需要使用jQuery。类似于:
$(document).ready(function(){
function ChangeFocus()
{
if($("#txtboxDay").val().length==2)
{
$("#txtboxmonth").focus();
}
}
$("#txtboxDay").bind("change",ChangeFocus);
});https://stackoverflow.com/questions/26987135
复制相似问题