开发者

Asp.Net form validation onkeyup

I rewrote the standard asp.net validation javascript so some (css)classes will be set either a validator is true or false.

This javascript is triggered on the "onchange" (standard asp.net behavior even开发者_运维问答t but I would like that this javascript is triggered "onkeyup"

Is there a way so change this?


You may put all your validators in one validation group and onkeyup trigger their validation.

Something like this:

<asp:TextBox ID="TextBox1" runat="server" ValidationGroup="Custom_ValidationGroup" onkeyup="Page_ClientValidate('Custom_ValidationGroup'); "/>

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" ForeColor="Red" ErrorMessage="Enter integers only." ValidationExpression="^\d+$" Display="Dynamic" ValidationGroup="Custom_ValidationGroup" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜