How to trigger Required Field Validator
In Aspnet, how to trigger RequiredFiel开发者_如何学JAVAdValidator when a textbox is clicked?
<asp:TextBox ID="TextBox1" runat="server" onclick="javascript:trig();"></asp:TextBox>
javascript function
function trig() {
ValidatorEnable(document.getElementById('<%= ValidatorID.ClientID %>'), true);
}
In ajax control toolkit, there is a control called validator callout that will help you to do this, link here http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ValidatorCallout/ValidatorCallout.aspx
精彩评论