开发者

Validation spanning a group of text boxes

开发者 https://www.devze.com 2023-02-16 18:24 出处:网络
I\'m trying to achieve the following: Where: Surname is always required NI Number OR Reference Number is required

I'm trying to achieve the following:

Validation spanning a group of text boxes

Where:

  • Surname is always required
  • NI Number OR Reference Number is required

Is this beyond the scop开发者_如何学JAVAe of the ASP.NET Validation Controls? The only solution I can think of is writing some bespoke javascript (for client side) and backing that up with some server side code.


One thing you can try is to have a CustomValidator(see here) check that both textboxes are not empty. Then validate both textboxes with a regular expression. The expression should check for either a valid entry OR a blank field.


You can create a CustomValidator and handle it there

http://msdn.microsoft.com/en-us/library/aa479013.aspx#aspnet-validateaspnetservercontrols_topic7

0

精彩评论

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