开发者

ASP.NET CustomValidator - is possible to change ClientValidationFunction on client side?

开发者 https://www.devze.com 2023-03-10 05:19 出处:网络
Is it possible to change ClientValidationFunction of ASP.NET CustomValidator on client side (from开发者_JAVA技巧 javascript)? I would like to select ClientValidationFunction dynamically in javascript,

Is it possible to change ClientValidationFunction of ASP.NET CustomValidator on client side (from开发者_JAVA技巧 javascript)? I would like to select ClientValidationFunction dynamically in javascript, to perform conditional validation (ClientValidationFunction will be set to validator depending on actions, which user does on page).

Is this approach possible, and how?

Thanks


I'm not sure if this is possible, but I would call from my client validation function separate functions belonging to my specified condition.

function myVal(sender, args)
{
   if ( [condition 1] ) return func_cond1( sender, args );
   else return func_cond2( sender, args );
}
0

精彩评论

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

关注公众号