开发者

ASP.NET Validators - is there a way to call a function in client side when validation ends?!

Let say there is a RequiredFieldValida开发者_高级运维tor and when validation happens I want to make some changes on the page (like show a hidden div) if validation fails,

Is there a way to call a function in js when the validation ends?! or do you have any other idea?!

Thanks,

Adler!


Why not write your own validator that extends RequiredFieldValidator?

This tutorial looks like it could help point you in the right direction:

Or you can write custom client side java validator:

<script type="text/javascript" language="javascript">
    function ValidateDropDown(source, arguments) {
        if (arguments.Value === 'NA') {
            arguments.IsValid = false;
        }
    }
</script>

<asp:CustomValidator ID="CoverServerCustomValidator" runat="server" ErrorMessage="<img src='../Themes/WebOrder/Images/weborder_Error.png'>"ToolTip="A Size is Required" Display="Dynamic" CssClass="Error" ValidationGroup="Sizing" OnServerValidate="ValidateDropDown" ControlToValidate="ddlCover" EnableClientScript="true"></asp:CustomValidator>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜