Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3422636
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:16:15+00:00 2026-05-18T06:16:15+00:00

Is there a way to add more than one ControlToValidate to my RegularExpressionValidator? I

  • 0

Is there a way to add more than one ControlToValidate to my RegularExpressionValidator?

I have two textboxes for postcode and I want to add the same RegularExpressionValidator to both.

Currently I have one for each box but if they are both wrong it shows up two error messages but I only want the user to see one.

Here’s my RegularExpressionValidator

<asp:RegularExpressionValidator CssClass="errorpopup" Display="Dynamic" ID="rvpPostCodeZone" validationgroup="tbEditEmailCorr" runat="server" ErrorMessage="<strong>Please enter a valid post code.</strong>" ControlToValidate="tbEditPostCodeZone"  ValidationExpression="^[0-9a-zA-Z' ']{3,}$" SetFocusOnError="true" />

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:16:15+00:00Added an answer on May 18, 2026 at 6:16 am

    You can use a CustomValidator, and perform the regex match server-side (and also on the client-side as well if you want). In the validation function(s) for this validator, check both controls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way or best practice to add more than one file (e.g.
Is there a way to use more than one ADONetAppender in the same application.
Is there a way in Python, to have more than one constructor or more
Is there a more compact and/or conventional way to write this? With ActiveSheet.QueryTables.Add(Connection:=URL;http://carbon.brighterplanet.com/flights.txt, Destination:=Range(A2))
Is there a way to add custom template inside Telerik MVC Combobox.? I have
I have a view which interacts with more than one controller (post, comments, categories...)
Hello I have a multi choice listview. I would like to add more than
I know that I can add more than one project to a solution, but
Can I add more than one validator to an object? For example: public interface
I created this regular expression to validate names: ^[a-zA-Z0-9\s\-\,]+.\*?$ Is there a way add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.