如何使用Javascript更改必需字段验证器dynamicaaly的验证组 [英] How to change the validation group of Required field validator dynamicaaly using Javascript

查看:48
本文介绍了如何使用Javascript更改必需字段验证器dynamicaaly的验证组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个单选按钮。单击第一个可见的Rbl 3文本框。当我点击第二个Rbl 4文本框是可见的。但是假设当我单击提交按钮并选择第二个Rbl时,它仅验证三个文本框而不是第四个文本框,因为我将它保存在不同的验证组中。总结我的问题是直截了当是否有任何方法我们可以使用javasript动态更改所需的字段验证器的验证组选择radiobutton :)。 Thanx。

I have two radio buttons. On clicking the first Rbl 3 textboxes visible. When i click the second Rbl 4 textboxes are visible. But suppose when i click the submit button and select second Rbl then it validates only the three textboxes not the fourth one because i have kept it in a diffrent validation group. To conclude my question is straight forward is there any way by which we can dynamically change the validation group of required field validator using javasript on selection of radiobutton :). Thanx.

推荐答案

http://stackoverflow.com/questions/13276690/how-to-change-customvalidator-validationgroup-in-javascript [ ^ ]



http://stackoverflow.com/questions/14101703/how-to-assign-validation- group-through-java-script [ ^ ]



这可能会对你有所帮助



问... :)



>>>>>>>>更新

http://stackoverflow.com/questions/13276690/how-to-change-customvalidator-validationgroup-in-javascript[^]

http://stackoverflow.com/questions/14101703/how-to-assign-validation-group-through-java-script[^]

this may be helpful to you

regards...:)

>>>>>>>>updated
<textbox id='txtsave' ></textbox>
<asp:requiredfieldvalidator id='' validationgroup='save'></asp:requiredfieldvalidator>
<asp:requiredfieldvalidator id='' validationgroup='save1'></asp:requiredfieldvalidator>
<asp:button validationgroup='save'>

now onclick of your radiobutton change validation group of button so second validations will be work


这篇关于如何使用Javascript更改必需字段验证器dynamicaaly的验证组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆