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

  • Home
  • SEARCH
  • 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 8844985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:37:34+00:00 2026-06-14T11:37:34+00:00

I have 3 filter textboxes on my asp.net page. Each textbox is assigned 2

  • 0

I have 3 filter textboxes on my asp.net page. Each textbox is assigned 2 regularexpressionvalidators to them, 1 for numeric and 1 for alpha. It detects the validations correctly but when i press my search button, it still postback even when the validation tooltip appears(showing the filter is invalid). Any ideas why its “ignoring” the validation and posting back anyways? Here is my definition of the 3 controls and their validations.

<td>
                <asp:TextBox ID="txtAcctFilter" runat="server" BackColor="#FF6600" TabIndex="1">Enter Account No</asp:TextBox>
                <asp:RegularExpressionValidator ID="revAcctFilter" runat="server" Text="*" ControlToValidate="txtAcctFilter"
                    ToolTip="Enter Valid Account" ValidationExpression="^\d*$" ValidationGroup="Numeric"></asp:RegularExpressionValidator>
                <asp:RegularExpressionValidator ID="revAcctFilter2" runat="server" ControlToValidate="txtAcctFilter"
                    ValidationExpression="^Enter Account No$" ValidationGroup="Alpha"></asp:RegularExpressionValidator>
            </td>
            <td>
                <asp:TextBox ID="txtYearFilter" runat="server" BackColor="#FF6600" TabIndex="2"> Enter Year</asp:TextBox>
                <asp:RegularExpressionValidator ID="RevYearFilter" runat="server" Text="*" ControlToValidate="txtYearFilter"
                    ToolTip="Enter Valid Year" ValidationExpression="^20\d{2}$" ValidationGroup="Numeric"></asp:RegularExpressionValidator>
                <asp:RegularExpressionValidator ID="RevYearFilter2" runat="server" ControlToValidate="txtYearFilter"
                    ValidationExpression="^Enter Year$" ValidationGroup="Alpha"></asp:RegularExpressionValidator>
            </td>
            <td>
                <asp:TextBox ID="txtMonthFilter" runat="server" BackColor="#FF6600" TabIndex="3">Enter Month</asp:TextBox>
                <asp:RegularExpressionValidator ID="RevMonthFilter" runat="server" Text="*" ControlToValidate="txtMonthFilter"
                    ToolTip="Enter Valid Month" ValidationExpression="^(1[0-2]|0?[1-9])$" ValidationGroup="Numeric"></asp:RegularExpressionValidator>
                <asp:RegularExpressionValidator ID="RevMonthFilter2" runat="server" ControlToValidate="txtMonthFilter"
                    ValidationExpression="^Enter Month$" ValidationGroup="Alpha"></asp:RegularExpressionValidator>
            </td>
  • 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-06-14T11:37:36+00:00Added an answer on June 14, 2026 at 11:37 am

    ValidationExpression=”^Enter Account No$|^\d+$” is the correct answer for this. I had to use the ^ $ tags for each side of the | to make it validate both sides. This allowed me to go back to just one expression. I also added the causesvalidation for each control to prevent a postback. So far its working 🙂

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

Sidebar

Related Questions

I have to filter user input to on my web ASP.NET page: <asp:TextBox runat=server
Possible Duplicate: ASP.NET TextBox filter If i have a textbox and i want to
I have a asp page and i have filter textboxes at the top. These
I have an asp.net web page which is giving me some problems. I developed
I have an ASP.NET TextBox ID=txtDate in my usercontrol. It has ValidationGroup=MyUC set. Now
I have HTML table on the ASP.NET MVC View page. Now I have to
I have an ASP.NET MVC application with a page that displays a large table
My ASP.NET page has an <asp:TextBox /> whose text input is encoded via HttpUtility.HtmlEncode();
I have 3 filter conditions on a web page Filter by dropdown Source Filter
I have an asp.net drop down list that has a number of items, users

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.