如何使用 JQuery 检查按钮单击时 asp TextBox 是否为空,如果是,则防止回发?
如果它是空的,显示一个警告对话框,要求用户输入一些东西也会很有帮助。
到目前为止,我有:
<asp:TextBox ID="txtInput" runat="server" />
<asp:Button ID="btnOK" Text="OK" onClientClick="return checkInput();" runat="server" />
我知道 JQuery 函数应该返回 true 或 false,但我不知道如何设置函数或者它是否应该进入内部$(document).ready(function () {});
。