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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:52:28+00:00 2026-05-10T14:52:28+00:00

I have an Asp.Net repeater, which contains a textbox and a checkbox. I need

  • 0

I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank.

I would like to use one or more of Asp.Net’s validator controls to accomplish this, to provide a consistent display for client side errors (server-side errors are handled by another subsystem).

The Asp:CompareValidator doesn’t seem to be flexible enough to perform this kind of complex comparison, so I’m left looking at the Asp:CustomValidator.

The problem I’m running into is that there doesn’t seem to be any way to pass custom information into the validation function. This is an issue because the ClientIds of the checkbox and the textbox are unknown to me at runtime (as they’re part of a Repeater).

So… My options seem to be:

  1. Pass the textbox and checkbox to the CustomValidator somehow (doesn’t seem to be possible).
  2. Find the TextBox through JavaScript based on the arguments passed in by the CustomValidator. Is this even possible, what with the ClientId being ambiguous?
  3. Forget validation entirely, and emit custom JavaScript (allowing me to pass both ClientIds to a custom function).

Any ideas on what might be a better way of implementing this?

  • 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. 2026-05-10T14:52:29+00:00Added an answer on May 10, 2026 at 2:52 pm

    I think the best way would be to inherit BaseValidator in a new class, and pass those IDs to your control as attributes. You should be able to resolve the IDs within your validator, without knowing the full client side ID that is generated at runtime. You should get the data validating on the server first, and on the client second.

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

Sidebar

Related Questions

I know that the asp.net repeater doesnt have a Client side object model, and
I have an ASP.NET repeater, which contains 3 divs inside the ItemTemplate. Each div,
I have a custom search control on my page (asp.net) which contains a textbox
I'm filtering an ASP.NET repeater that's outputting over 2000 divs on the client side
I have an ASP.NET repeater that shows a list of items with a delete
I have an image in a repeater in ASP.NET. I need to set the
I have a repeater that's bound to a SQL Data Source (using ASP.NET). Are
I have an ASP.net repeater on my page which creates a load of listitems.
I have a ASP.NET 3.5 page which has a repeater containing lines of information
I have an asp.net repeater which binds the memberid to the id of the

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.