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 5941685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:08:42+00:00 2026-05-22T16:08:42+00:00

I have 2 textbox; on one textbox I have two validations 1) required field

  • 0

I have 2 textbox; on one textbox I have two validations

1) required field validation for entering value and
2) regular expression which take Employee_id binary(7), its format is - B-____ i.e B- will be fix 5 digits preceding it and what would be the format of this?

Another textbox has phone no. What would be the format of indian standard phone no.?

What will be the regular expression for these

<table>
 <td class="style35">
                &nbsp;</td>
            <td class="style32">
                <asp:Label ID="Lbl_Emp_Code" runat="server" Font-Bold="True" 
                    Text="Employee Code"></asp:Label>
            </td>
            <td class="style34">
                <asp:TextBox ID="Txt_Code" runat="server"></asp:TextBox>
            </td>
            <td class="style31">
                <asp:RequiredFieldValidator ID="Rfv_code" runat="server" 
                    ControlToValidate="Txt_Code" ErrorMessage="Please Enter Employee Code">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="R_exp_v_Code" runat="server" 
                    ControlToValidate="Txt_Code" 
                    ErrorMessage="Please Enter correct Format of Employee Code">*</asp:RegularExpressionValidator>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style35">
                &nbsp;</td>
            <td class="style32">
                <asp:Label ID="Lbl_Emp_Name" runat="server" Font-Bold="True" 
                    Text="Employee Name"></asp:Label>
            </td>
            <td class="style34">
                <asp:TextBox ID="Txt_Name" runat="server"></asp:TextBox>
            </td>
            <td class="style31">
                <asp:RequiredFieldValidator ID="Rfv_name" runat="server" 
                    ControlToValidate="Txt_Name" ErrorMessage="Please Enter Employee Name">*</asp:RequiredFieldValidator>
            </td>
            <td>
                &nbsp;</td>

</table>
  • 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-22T16:08:42+00:00Added an answer on May 22, 2026 at 4:08 pm

    Ok, if I have understood your question right, you have 2 textboxes

    1- EmployeeID (has the format B-[5 digit number])

    2- EmployeeNumber (Indian tel. no. [not sure if you mean a cell phone number or a fixed line number])

    so here’s the answer based on my understanding

    You can use the ValidationExpression property of the <asp:RegularExpressionValidator> tag to specify you regular expression.

    For your EmployeeID (B-[5 digit number]) you can try ^[B-]\d{5} as your regEx.

    and for your EmployeeNumber you can try \d{8} for fixed-line number and \d{10} for cell phone numbers.

    hope it helps.

    PS: although I personally feel it’s a lot simpler to understand/write using Regex.

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

Sidebar

Related Questions

I have some code where I need two separate required field validators for one
Iam using one Jquery Library which takes the Regular expression in json format in
I have one one web page which one one textbox for receiving the dollar
I have two text boxes, one for a billing address field and one for
i have two textbox using calaendarExtender and one label. My needed is if i
I have two validation scripts which work in their own right, but I now
I have two types of filed one is Required and Other is Not Required.
I have form autocomplete code that executes when value changes in one textbox. It
I have a question regarding the binding I have two textbox, textbox one is
I have two textboxes and when TAB is pressed from one textbox it goes

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.