开发者

MVC3 Want Clientside Validation to trigger for two fields when one of the two is modified

I am creating an MVC3 website and added a couple of security questions to the "My MVC Application" Registration routine in the form of dropdown boxes. I created a custom validator to check the second dropdown box and if the selected item is the same as the first then it shows an error message.

My problem is that the clientside validation triggers as soon as the second dropdown box loses focus. After the error is displayed, ideally, I should be able to change the selection in the first dropdown box and the validation error message for the second dropdown box should go away. But, of course, changing the first dropdown box does not trigger the clientside validation routine for the second dropdown box and the error does not go away.

I wou开发者_JAVA技巧ld appreciate it if someone who is well versed with the internalls of unobstrosive Ajax validation routines would guide me to a solution so that when the selection of one dropdown box changes the validation routine of both dropdown boxes is triggered.

Thanks a bunch for any pointers.


If you look at this question and my answer, you will see code for client-side validation where changing one field will trigger validation on another field, and will then stop after both fields' validation has run.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜